Lines Matching full:packet

31 	[INTEL_PT_BAD]		= "Bad Packet!",
74 struct intel_pt_pkt *packet) in intel_pt_get_long_tnt() argument
90 packet->type = INTEL_PT_TNT; in intel_pt_get_long_tnt()
91 packet->count = count; in intel_pt_get_long_tnt()
92 packet->payload = payload << 1; in intel_pt_get_long_tnt()
97 struct intel_pt_pkt *packet) in intel_pt_get_pip() argument
104 packet->type = INTEL_PT_PIP; in intel_pt_get_pip()
106 packet->payload = payload; in intel_pt_get_pip()
111 static int intel_pt_get_tracestop(struct intel_pt_pkt *packet) in intel_pt_get_tracestop() argument
113 packet->type = INTEL_PT_TRACESTOP; in intel_pt_get_tracestop()
118 struct intel_pt_pkt *packet) in intel_pt_get_cbr() argument
122 packet->type = INTEL_PT_CBR; in intel_pt_get_cbr()
123 packet->payload = get_unaligned_le16(buf + 2); in intel_pt_get_cbr()
128 struct intel_pt_pkt *packet) in intel_pt_get_vmcs() argument
133 packet->type = INTEL_PT_VMCS; in intel_pt_get_vmcs()
134 packet->count = 5; in intel_pt_get_vmcs()
135 memcpy_le64(&packet->payload, buf + 2, 5); in intel_pt_get_vmcs()
140 static int intel_pt_get_ovf(struct intel_pt_pkt *packet) in intel_pt_get_ovf() argument
142 packet->type = INTEL_PT_OVF; in intel_pt_get_ovf()
147 struct intel_pt_pkt *packet) in intel_pt_get_psb() argument
159 packet->type = INTEL_PT_PSB; in intel_pt_get_psb()
163 static int intel_pt_get_psbend(struct intel_pt_pkt *packet) in intel_pt_get_psbend() argument
165 packet->type = INTEL_PT_PSBEND; in intel_pt_get_psbend()
170 struct intel_pt_pkt *packet) in intel_pt_get_tma() argument
175 packet->type = INTEL_PT_TMA; in intel_pt_get_tma()
176 packet->payload = buf[2] | (buf[3] << 8); in intel_pt_get_tma()
177 packet->count = buf[5] | ((buf[6] & BIT(0)) << 8); in intel_pt_get_tma()
181 static int intel_pt_get_pad(struct intel_pt_pkt *packet) in intel_pt_get_pad() argument
183 packet->type = INTEL_PT_PAD; in intel_pt_get_pad()
188 struct intel_pt_pkt *packet) in intel_pt_get_mnt() argument
192 packet->type = INTEL_PT_MNT; in intel_pt_get_mnt()
193 packet->payload = get_unaligned_le64(buf + 3); in intel_pt_get_mnt()
198 struct intel_pt_pkt *packet) in intel_pt_get_3byte() argument
205 return intel_pt_get_mnt(buf, len, packet); in intel_pt_get_3byte()
212 struct intel_pt_pkt *packet) in intel_pt_get_ptwrite() argument
214 packet->count = (buf[1] >> 5) & 0x3; in intel_pt_get_ptwrite()
215 packet->type = buf[1] & BIT(7) ? INTEL_PT_PTWRITE_IP : in intel_pt_get_ptwrite()
218 switch (packet->count) { in intel_pt_get_ptwrite()
222 packet->payload = get_unaligned_le32(buf + 2); in intel_pt_get_ptwrite()
227 packet->payload = get_unaligned_le64(buf + 2); in intel_pt_get_ptwrite()
234 static int intel_pt_get_exstop(struct intel_pt_pkt *packet) in intel_pt_get_exstop() argument
236 packet->type = INTEL_PT_EXSTOP; in intel_pt_get_exstop()
240 static int intel_pt_get_exstop_ip(struct intel_pt_pkt *packet) in intel_pt_get_exstop_ip() argument
242 packet->type = INTEL_PT_EXSTOP_IP; in intel_pt_get_exstop_ip()
247 struct intel_pt_pkt *packet) in intel_pt_get_mwait() argument
251 packet->type = INTEL_PT_MWAIT; in intel_pt_get_mwait()
252 packet->payload = get_unaligned_le64(buf + 2); in intel_pt_get_mwait()
257 struct intel_pt_pkt *packet) in intel_pt_get_pwre() argument
261 packet->type = INTEL_PT_PWRE; in intel_pt_get_pwre()
262 memcpy_le64(&packet->payload, buf + 2, 2); in intel_pt_get_pwre()
267 struct intel_pt_pkt *packet) in intel_pt_get_pwrx() argument
271 packet->type = INTEL_PT_PWRX; in intel_pt_get_pwrx()
272 memcpy_le64(&packet->payload, buf + 2, 5); in intel_pt_get_pwrx()
277 struct intel_pt_pkt *packet) in intel_pt_get_bbp() argument
281 packet->type = INTEL_PT_BBP; in intel_pt_get_bbp()
282 packet->count = buf[2] >> 7; in intel_pt_get_bbp()
283 packet->payload = buf[2] & 0x1f; in intel_pt_get_bbp()
288 struct intel_pt_pkt *packet) in intel_pt_get_bip_4() argument
292 packet->type = INTEL_PT_BIP; in intel_pt_get_bip_4()
293 packet->count = buf[0] >> 3; in intel_pt_get_bip_4()
294 memcpy_le64(&packet->payload, buf + 1, 4); in intel_pt_get_bip_4()
299 struct intel_pt_pkt *packet) in intel_pt_get_bip_8() argument
303 packet->type = INTEL_PT_BIP; in intel_pt_get_bip_8()
304 packet->count = buf[0] >> 3; in intel_pt_get_bip_8()
305 packet->payload = get_unaligned_le64(buf + 1); in intel_pt_get_bip_8()
309 static int intel_pt_get_bep(size_t len, struct intel_pt_pkt *packet) in intel_pt_get_bep() argument
313 packet->type = INTEL_PT_BEP; in intel_pt_get_bep()
317 static int intel_pt_get_bep_ip(size_t len, struct intel_pt_pkt *packet) in intel_pt_get_bep_ip() argument
321 packet->type = INTEL_PT_BEP_IP; in intel_pt_get_bep_ip()
326 struct intel_pt_pkt *packet) in intel_pt_get_cfe() argument
330 packet->type = buf[2] & 0x80 ? INTEL_PT_CFE_IP : INTEL_PT_CFE; in intel_pt_get_cfe()
331 packet->count = buf[2] & 0x1f; in intel_pt_get_cfe()
332 packet->payload = buf[3]; in intel_pt_get_cfe()
337 struct intel_pt_pkt *packet) in intel_pt_get_evd() argument
341 packet->type = INTEL_PT_EVD; in intel_pt_get_evd()
342 packet->count = buf[2] & 0x3f; in intel_pt_get_evd()
343 packet->payload = buf[3]; in intel_pt_get_evd()
344 packet->payload = get_unaligned_le64(buf + 3); in intel_pt_get_evd()
349 struct intel_pt_pkt *packet) in intel_pt_get_ext() argument
355 return intel_pt_get_ptwrite(buf, len, packet); in intel_pt_get_ext()
359 return intel_pt_get_long_tnt(buf, len, packet); in intel_pt_get_ext()
361 return intel_pt_get_pip(buf, len, packet); in intel_pt_get_ext()
363 return intel_pt_get_tracestop(packet); in intel_pt_get_ext()
365 return intel_pt_get_cbr(buf, len, packet); in intel_pt_get_ext()
367 return intel_pt_get_vmcs(buf, len, packet); in intel_pt_get_ext()
369 return intel_pt_get_ovf(packet); in intel_pt_get_ext()
371 return intel_pt_get_psb(buf, len, packet); in intel_pt_get_ext()
373 return intel_pt_get_psbend(packet); in intel_pt_get_ext()
375 return intel_pt_get_tma(buf, len, packet); in intel_pt_get_ext()
377 return intel_pt_get_3byte(buf, len, packet); in intel_pt_get_ext()
379 return intel_pt_get_exstop(packet); in intel_pt_get_ext()
381 return intel_pt_get_exstop_ip(packet); in intel_pt_get_ext()
383 return intel_pt_get_mwait(buf, len, packet); in intel_pt_get_ext()
385 return intel_pt_get_pwre(buf, len, packet); in intel_pt_get_ext()
387 return intel_pt_get_pwrx(buf, len, packet); in intel_pt_get_ext()
389 return intel_pt_get_bbp(buf, len, packet); in intel_pt_get_ext()
391 return intel_pt_get_bep(len, packet); in intel_pt_get_ext()
393 return intel_pt_get_bep_ip(len, packet); in intel_pt_get_ext()
395 return intel_pt_get_cfe(buf, len, packet); in intel_pt_get_ext()
397 return intel_pt_get_evd(buf, len, packet); in intel_pt_get_ext()
404 struct intel_pt_pkt *packet) in intel_pt_get_short_tnt() argument
414 packet->type = INTEL_PT_TNT; in intel_pt_get_short_tnt()
415 packet->count = count; in intel_pt_get_short_tnt()
416 packet->payload = (uint64_t)byte << 57; in intel_pt_get_short_tnt()
422 size_t len, struct intel_pt_pkt *packet) in intel_pt_get_cyc() argument
438 packet->type = INTEL_PT_CYC; in intel_pt_get_cyc()
439 packet->payload = payload; in intel_pt_get_cyc()
445 struct intel_pt_pkt *packet) in intel_pt_get_ip() argument
449 packet->count = byte >> 5; in intel_pt_get_ip()
451 switch (packet->count) { in intel_pt_get_ip()
459 packet->payload = get_unaligned_le16(buf + 1); in intel_pt_get_ip()
465 packet->payload = get_unaligned_le32(buf + 1); in intel_pt_get_ip()
472 memcpy_le64(&packet->payload, buf + 1, 6); in intel_pt_get_ip()
478 packet->payload = get_unaligned_le64(buf + 1); in intel_pt_get_ip()
484 packet->type = type; in intel_pt_get_ip()
490 struct intel_pt_pkt *packet) in intel_pt_get_mode() argument
497 packet->type = INTEL_PT_MODE_EXEC; in intel_pt_get_mode()
498 packet->count = buf[1]; in intel_pt_get_mode()
501 packet->payload = 16; in intel_pt_get_mode()
504 packet->payload = 64; in intel_pt_get_mode()
507 packet->payload = 32; in intel_pt_get_mode()
514 packet->type = INTEL_PT_MODE_TSX; in intel_pt_get_mode()
517 packet->payload = buf[1] & 3; in intel_pt_get_mode()
527 struct intel_pt_pkt *packet) in intel_pt_get_tsc() argument
531 packet->type = INTEL_PT_TSC; in intel_pt_get_tsc()
532 memcpy_le64(&packet->payload, buf + 1, 7); in intel_pt_get_tsc()
537 struct intel_pt_pkt *packet) in intel_pt_get_mtc() argument
541 packet->type = INTEL_PT_MTC; in intel_pt_get_mtc()
542 packet->payload = buf[1]; in intel_pt_get_mtc()
547 struct intel_pt_pkt *packet, in intel_pt_do_get_packet() argument
552 memset(packet, 0, sizeof(struct intel_pt_pkt)); in intel_pt_do_get_packet()
564 return intel_pt_get_bip_4(buf, len, packet); in intel_pt_do_get_packet()
568 return intel_pt_get_bip_8(buf, len, packet); in intel_pt_do_get_packet()
576 return intel_pt_get_pad(packet); in intel_pt_do_get_packet()
578 return intel_pt_get_ext(buf, len, packet); in intel_pt_do_get_packet()
579 return intel_pt_get_short_tnt(byte, packet); in intel_pt_do_get_packet()
583 return intel_pt_get_cyc(byte, buf, len, packet); in intel_pt_do_get_packet()
587 return intel_pt_get_ip(INTEL_PT_TIP, byte, buf, len, packet); in intel_pt_do_get_packet()
590 packet); in intel_pt_do_get_packet()
593 packet); in intel_pt_do_get_packet()
595 return intel_pt_get_ip(INTEL_PT_FUP, byte, buf, len, packet); in intel_pt_do_get_packet()
599 return intel_pt_get_mode(buf, len, packet); in intel_pt_do_get_packet()
601 return intel_pt_get_tsc(buf, len, packet); in intel_pt_do_get_packet()
603 return intel_pt_get_mtc(buf, len, packet); in intel_pt_do_get_packet()
612 void intel_pt_upd_pkt_ctx(const struct intel_pt_pkt *packet, in intel_pt_upd_pkt_ctx() argument
615 switch (packet->type) { in intel_pt_upd_pkt_ctx()
654 if (packet->count) in intel_pt_upd_pkt_ctx()
665 struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx *ctx) in intel_pt_get_packet() argument
669 ret = intel_pt_do_get_packet(buf, len, packet, *ctx); in intel_pt_get_packet()
673 intel_pt_upd_pkt_ctx(packet, ctx); in intel_pt_get_packet()
678 int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, in intel_pt_pkt_desc() argument
682 unsigned long long payload = packet->payload; in intel_pt_pkt_desc()
683 const char *name = intel_pt_pkt_name(packet->type); in intel_pt_pkt_desc()
685 switch (packet->type) { in intel_pt_pkt_desc()
701 for (i = 0; i < packet->count; i++) { in intel_pt_pkt_desc()
712 ret = snprintf(buf, blen, " (%d)", packet->count); in intel_pt_pkt_desc()
722 if (!(packet->count)) in intel_pt_pkt_desc()
734 (unsigned)payload, packet->count); in intel_pt_pkt_desc()
737 name, !!(packet->count & 4), payload); in intel_pt_pkt_desc()
743 nr = packet->payload & INTEL_PT_VMX_NR_FLAG ? 1 : 0; in intel_pt_pkt_desc()
775 name, packet->count ? "4" : "8", payload); in intel_pt_pkt_desc()
778 name, packet->count, payload); in intel_pt_pkt_desc()
782 name, packet->type == INTEL_PT_CFE_IP, packet->count, payload); in intel_pt_pkt_desc()
785 name, packet->count, payload); in intel_pt_pkt_desc()
790 name, payload, packet->count); in intel_pt_pkt_desc()