Lines Matching refs:packet
78 struct intel_pt_pkt *packet) in intel_pt_get_long_tnt() argument
94 packet->type = INTEL_PT_TNT; in intel_pt_get_long_tnt()
95 packet->count = count; in intel_pt_get_long_tnt()
96 packet->payload = payload << 1; in intel_pt_get_long_tnt()
101 struct intel_pt_pkt *packet) in intel_pt_get_pip() argument
108 packet->type = INTEL_PT_PIP; in intel_pt_get_pip()
110 packet->payload = payload; in intel_pt_get_pip()
115 static int intel_pt_get_tracestop(struct intel_pt_pkt *packet) in intel_pt_get_tracestop() argument
117 packet->type = INTEL_PT_TRACESTOP; in intel_pt_get_tracestop()
122 struct intel_pt_pkt *packet) in intel_pt_get_cbr() argument
126 packet->type = INTEL_PT_CBR; in intel_pt_get_cbr()
127 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 2)); in intel_pt_get_cbr()
132 struct intel_pt_pkt *packet) in intel_pt_get_vmcs() argument
142 packet->type = INTEL_PT_VMCS; in intel_pt_get_vmcs()
143 packet->count = count; in intel_pt_get_vmcs()
144 memcpy_le64(&packet->payload, buf + 2, count); in intel_pt_get_vmcs()
149 static int intel_pt_get_ovf(struct intel_pt_pkt *packet) in intel_pt_get_ovf() argument
151 packet->type = INTEL_PT_OVF; in intel_pt_get_ovf()
156 struct intel_pt_pkt *packet) in intel_pt_get_psb() argument
168 packet->type = INTEL_PT_PSB; in intel_pt_get_psb()
172 static int intel_pt_get_psbend(struct intel_pt_pkt *packet) in intel_pt_get_psbend() argument
174 packet->type = INTEL_PT_PSBEND; in intel_pt_get_psbend()
179 struct intel_pt_pkt *packet) in intel_pt_get_tma() argument
184 packet->type = INTEL_PT_TMA; in intel_pt_get_tma()
185 packet->payload = buf[2] | (buf[3] << 8); in intel_pt_get_tma()
186 packet->count = buf[5] | ((buf[6] & BIT(0)) << 8); in intel_pt_get_tma()
190 static int intel_pt_get_pad(struct intel_pt_pkt *packet) in intel_pt_get_pad() argument
192 packet->type = INTEL_PT_PAD; in intel_pt_get_pad()
197 struct intel_pt_pkt *packet) in intel_pt_get_mnt() argument
201 packet->type = INTEL_PT_MNT; in intel_pt_get_mnt()
202 memcpy_le64(&packet->payload, buf + 3, 8); in intel_pt_get_mnt()
207 struct intel_pt_pkt *packet) in intel_pt_get_3byte() argument
214 return intel_pt_get_mnt(buf, len, packet); in intel_pt_get_3byte()
221 struct intel_pt_pkt *packet) in intel_pt_get_ptwrite() argument
223 packet->count = (buf[1] >> 5) & 0x3; in intel_pt_get_ptwrite()
224 packet->type = buf[1] & BIT(7) ? INTEL_PT_PTWRITE_IP : in intel_pt_get_ptwrite()
227 switch (packet->count) { in intel_pt_get_ptwrite()
231 packet->payload = le32_to_cpu(*(uint32_t *)(buf + 2)); in intel_pt_get_ptwrite()
236 packet->payload = le64_to_cpu(*(uint64_t *)(buf + 2)); in intel_pt_get_ptwrite()
243 static int intel_pt_get_exstop(struct intel_pt_pkt *packet) in intel_pt_get_exstop() argument
245 packet->type = INTEL_PT_EXSTOP; in intel_pt_get_exstop()
249 static int intel_pt_get_exstop_ip(struct intel_pt_pkt *packet) in intel_pt_get_exstop_ip() argument
251 packet->type = INTEL_PT_EXSTOP_IP; in intel_pt_get_exstop_ip()
256 struct intel_pt_pkt *packet) in intel_pt_get_mwait() argument
260 packet->type = INTEL_PT_MWAIT; in intel_pt_get_mwait()
261 packet->payload = le64_to_cpu(*(uint64_t *)(buf + 2)); in intel_pt_get_mwait()
266 struct intel_pt_pkt *packet) in intel_pt_get_pwre() argument
270 packet->type = INTEL_PT_PWRE; in intel_pt_get_pwre()
271 memcpy_le64(&packet->payload, buf + 2, 2); in intel_pt_get_pwre()
276 struct intel_pt_pkt *packet) in intel_pt_get_pwrx() argument
280 packet->type = INTEL_PT_PWRX; in intel_pt_get_pwrx()
281 memcpy_le64(&packet->payload, buf + 2, 5); in intel_pt_get_pwrx()
286 struct intel_pt_pkt *packet) in intel_pt_get_bbp() argument
290 packet->type = INTEL_PT_BBP; in intel_pt_get_bbp()
291 packet->count = buf[2] >> 7; in intel_pt_get_bbp()
292 packet->payload = buf[2] & 0x1f; in intel_pt_get_bbp()
297 struct intel_pt_pkt *packet) in intel_pt_get_bip_4() argument
301 packet->type = INTEL_PT_BIP; in intel_pt_get_bip_4()
302 packet->count = buf[0] >> 3; in intel_pt_get_bip_4()
303 memcpy_le64(&packet->payload, buf + 1, 4); in intel_pt_get_bip_4()
308 struct intel_pt_pkt *packet) in intel_pt_get_bip_8() argument
312 packet->type = INTEL_PT_BIP; in intel_pt_get_bip_8()
313 packet->count = buf[0] >> 3; in intel_pt_get_bip_8()
314 memcpy_le64(&packet->payload, buf + 1, 8); in intel_pt_get_bip_8()
318 static int intel_pt_get_bep(size_t len, struct intel_pt_pkt *packet) in intel_pt_get_bep() argument
322 packet->type = INTEL_PT_BEP; in intel_pt_get_bep()
326 static int intel_pt_get_bep_ip(size_t len, struct intel_pt_pkt *packet) in intel_pt_get_bep_ip() argument
330 packet->type = INTEL_PT_BEP_IP; in intel_pt_get_bep_ip()
335 struct intel_pt_pkt *packet) in intel_pt_get_cfe() argument
339 packet->type = buf[2] & 0x80 ? INTEL_PT_CFE_IP : INTEL_PT_CFE; in intel_pt_get_cfe()
340 packet->count = buf[2] & 0x1f; in intel_pt_get_cfe()
341 packet->payload = buf[3]; in intel_pt_get_cfe()
346 struct intel_pt_pkt *packet) in intel_pt_get_evd() argument
350 packet->type = INTEL_PT_EVD; in intel_pt_get_evd()
351 packet->count = buf[2] & 0x3f; in intel_pt_get_evd()
352 packet->payload = buf[3]; in intel_pt_get_evd()
353 memcpy_le64(&packet->payload, buf + 3, 8); in intel_pt_get_evd()
358 struct intel_pt_pkt *packet) in intel_pt_get_ext() argument
364 return intel_pt_get_ptwrite(buf, len, packet); in intel_pt_get_ext()
368 return intel_pt_get_long_tnt(buf, len, packet); in intel_pt_get_ext()
370 return intel_pt_get_pip(buf, len, packet); in intel_pt_get_ext()
372 return intel_pt_get_tracestop(packet); in intel_pt_get_ext()
374 return intel_pt_get_cbr(buf, len, packet); in intel_pt_get_ext()
376 return intel_pt_get_vmcs(buf, len, packet); in intel_pt_get_ext()
378 return intel_pt_get_ovf(packet); in intel_pt_get_ext()
380 return intel_pt_get_psb(buf, len, packet); in intel_pt_get_ext()
382 return intel_pt_get_psbend(packet); in intel_pt_get_ext()
384 return intel_pt_get_tma(buf, len, packet); in intel_pt_get_ext()
386 return intel_pt_get_3byte(buf, len, packet); in intel_pt_get_ext()
388 return intel_pt_get_exstop(packet); in intel_pt_get_ext()
390 return intel_pt_get_exstop_ip(packet); in intel_pt_get_ext()
392 return intel_pt_get_mwait(buf, len, packet); in intel_pt_get_ext()
394 return intel_pt_get_pwre(buf, len, packet); in intel_pt_get_ext()
396 return intel_pt_get_pwrx(buf, len, packet); in intel_pt_get_ext()
398 return intel_pt_get_bbp(buf, len, packet); in intel_pt_get_ext()
400 return intel_pt_get_bep(len, packet); in intel_pt_get_ext()
402 return intel_pt_get_bep_ip(len, packet); in intel_pt_get_ext()
404 return intel_pt_get_cfe(buf, len, packet); in intel_pt_get_ext()
406 return intel_pt_get_evd(buf, len, packet); in intel_pt_get_ext()
413 struct intel_pt_pkt *packet) in intel_pt_get_short_tnt() argument
423 packet->type = INTEL_PT_TNT; in intel_pt_get_short_tnt()
424 packet->count = count; in intel_pt_get_short_tnt()
425 packet->payload = (uint64_t)byte << 57; in intel_pt_get_short_tnt()
431 size_t len, struct intel_pt_pkt *packet) in intel_pt_get_cyc() argument
447 packet->type = INTEL_PT_CYC; in intel_pt_get_cyc()
448 packet->payload = payload; in intel_pt_get_cyc()
454 struct intel_pt_pkt *packet) in intel_pt_get_ip() argument
458 packet->count = byte >> 5; in intel_pt_get_ip()
460 switch (packet->count) { in intel_pt_get_ip()
468 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 1)); in intel_pt_get_ip()
474 packet->payload = le32_to_cpu(*(uint32_t *)(buf + 1)); in intel_pt_get_ip()
481 memcpy_le64(&packet->payload, buf + 1, 6); in intel_pt_get_ip()
487 packet->payload = le64_to_cpu(*(uint64_t *)(buf + 1)); in intel_pt_get_ip()
493 packet->type = type; in intel_pt_get_ip()
499 struct intel_pt_pkt *packet) in intel_pt_get_mode() argument
506 packet->type = INTEL_PT_MODE_EXEC; in intel_pt_get_mode()
507 packet->count = buf[1]; in intel_pt_get_mode()
510 packet->payload = 16; in intel_pt_get_mode()
513 packet->payload = 64; in intel_pt_get_mode()
516 packet->payload = 32; in intel_pt_get_mode()
523 packet->type = INTEL_PT_MODE_TSX; in intel_pt_get_mode()
526 packet->payload = buf[1] & 3; in intel_pt_get_mode()
536 struct intel_pt_pkt *packet) in intel_pt_get_tsc() argument
540 packet->type = INTEL_PT_TSC; in intel_pt_get_tsc()
541 memcpy_le64(&packet->payload, buf + 1, 7); in intel_pt_get_tsc()
546 struct intel_pt_pkt *packet) in intel_pt_get_mtc() argument
550 packet->type = INTEL_PT_MTC; in intel_pt_get_mtc()
551 packet->payload = buf[1]; in intel_pt_get_mtc()
556 struct intel_pt_pkt *packet, in intel_pt_do_get_packet() argument
561 memset(packet, 0, sizeof(struct intel_pt_pkt)); in intel_pt_do_get_packet()
573 return intel_pt_get_bip_4(buf, len, packet); in intel_pt_do_get_packet()
577 return intel_pt_get_bip_8(buf, len, packet); in intel_pt_do_get_packet()
585 return intel_pt_get_pad(packet); in intel_pt_do_get_packet()
587 return intel_pt_get_ext(buf, len, packet); in intel_pt_do_get_packet()
588 return intel_pt_get_short_tnt(byte, packet); in intel_pt_do_get_packet()
592 return intel_pt_get_cyc(byte, buf, len, packet); in intel_pt_do_get_packet()
596 return intel_pt_get_ip(INTEL_PT_TIP, byte, buf, len, packet); in intel_pt_do_get_packet()
599 packet); in intel_pt_do_get_packet()
602 packet); in intel_pt_do_get_packet()
604 return intel_pt_get_ip(INTEL_PT_FUP, byte, buf, len, packet); in intel_pt_do_get_packet()
608 return intel_pt_get_mode(buf, len, packet); in intel_pt_do_get_packet()
610 return intel_pt_get_tsc(buf, len, packet); in intel_pt_do_get_packet()
612 return intel_pt_get_mtc(buf, len, packet); in intel_pt_do_get_packet()
621 void intel_pt_upd_pkt_ctx(const struct intel_pt_pkt *packet, in intel_pt_upd_pkt_ctx() argument
624 switch (packet->type) { in intel_pt_upd_pkt_ctx()
663 if (packet->count) in intel_pt_upd_pkt_ctx()
674 struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx *ctx) in intel_pt_get_packet() argument
678 ret = intel_pt_do_get_packet(buf, len, packet, *ctx); in intel_pt_get_packet()
682 intel_pt_upd_pkt_ctx(packet, ctx); in intel_pt_get_packet()
687 int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, in intel_pt_pkt_desc() argument
691 unsigned long long payload = packet->payload; in intel_pt_pkt_desc()
692 const char *name = intel_pt_pkt_name(packet->type); in intel_pt_pkt_desc()
694 switch (packet->type) { in intel_pt_pkt_desc()
710 for (i = 0; i < packet->count; i++) { in intel_pt_pkt_desc()
721 ret = snprintf(buf, blen, " (%d)", packet->count); in intel_pt_pkt_desc()
731 if (!(packet->count)) in intel_pt_pkt_desc()
743 (unsigned)payload, packet->count); in intel_pt_pkt_desc()
746 name, !!(packet->count & 4), payload); in intel_pt_pkt_desc()
752 nr = packet->payload & INTEL_PT_VMX_NR_FLAG ? 1 : 0; in intel_pt_pkt_desc()
784 name, packet->count ? "4" : "8", payload); in intel_pt_pkt_desc()
787 name, packet->count, payload); in intel_pt_pkt_desc()
791 name, packet->type == INTEL_PT_CFE_IP, packet->count, payload); in intel_pt_pkt_desc()
794 name, packet->count, payload); in intel_pt_pkt_desc()
799 name, payload, packet->count); in intel_pt_pkt_desc()