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