Lines Matching defs:packet

77 				 struct intel_pt_pkt *packet)
93 packet->type = INTEL_PT_TNT;
94 packet->count = count;
95 packet->payload = payload << 1;
100 struct intel_pt_pkt *packet)
107 packet->type = INTEL_PT_PIP;
109 packet->payload = payload >> 1;
111 packet->payload |= NR_FLAG;
116 static int intel_pt_get_tracestop(struct intel_pt_pkt *packet)
118 packet->type = INTEL_PT_TRACESTOP;
123 struct intel_pt_pkt *packet)
127 packet->type = INTEL_PT_CBR;
128 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 2));
133 struct intel_pt_pkt *packet)
143 packet->type = INTEL_PT_VMCS;
144 packet->count = count;
145 memcpy_le64(&packet->payload, buf + 2, count);
150 static int intel_pt_get_ovf(struct intel_pt_pkt *packet)
152 packet->type = INTEL_PT_OVF;
157 struct intel_pt_pkt *packet)
169 packet->type = INTEL_PT_PSB;
173 static int intel_pt_get_psbend(struct intel_pt_pkt *packet)
175 packet->type = INTEL_PT_PSBEND;
180 struct intel_pt_pkt *packet)
185 packet->type = INTEL_PT_TMA;
186 packet->payload = buf[2] | (buf[3] << 8);
187 packet->count = buf[5] | ((buf[6] & BIT(0)) << 8);
191 static int intel_pt_get_pad(struct intel_pt_pkt *packet)
193 packet->type = INTEL_PT_PAD;
198 struct intel_pt_pkt *packet)
202 packet->type = INTEL_PT_MNT;
203 memcpy_le64(&packet->payload, buf + 3, 8);
209 struct intel_pt_pkt *packet)
216 return intel_pt_get_mnt(buf, len, packet);
223 struct intel_pt_pkt *packet)
225 packet->count = (buf[1] >> 5) & 0x3;
226 packet->type = buf[1] & BIT(7) ? INTEL_PT_PTWRITE_IP :
229 switch (packet->count) {
233 packet->payload = le32_to_cpu(*(uint32_t *)(buf + 2));
238 packet->payload = le64_to_cpu(*(uint64_t *)(buf + 2));
245 static int intel_pt_get_exstop(struct intel_pt_pkt *packet)
247 packet->type = INTEL_PT_EXSTOP;
251 static int intel_pt_get_exstop_ip(struct intel_pt_pkt *packet)
253 packet->type = INTEL_PT_EXSTOP_IP;
258 struct intel_pt_pkt *packet)
262 packet->type = INTEL_PT_MWAIT;
263 packet->payload = le64_to_cpu(*(uint64_t *)(buf + 2));
268 struct intel_pt_pkt *packet)
272 packet->type = INTEL_PT_PWRE;
273 memcpy_le64(&packet->payload, buf + 2, 2);
278 struct intel_pt_pkt *packet)
282 packet->type = INTEL_PT_PWRX;
283 memcpy_le64(&packet->payload, buf + 2, 5);
288 struct intel_pt_pkt *packet)
292 packet->type = INTEL_PT_BBP;
293 packet->count = buf[2] >> 7;
294 packet->payload = buf[2] & 0x1f;
299 struct intel_pt_pkt *packet)
303 packet->type = INTEL_PT_BIP;
304 packet->count = buf[0] >> 3;
305 memcpy_le64(&packet->payload, buf + 1, 4);
310 struct intel_pt_pkt *packet)
314 packet->type = INTEL_PT_BIP;
315 packet->count = buf[0] >> 3;
316 memcpy_le64(&packet->payload, buf + 1, 8);
320 static int intel_pt_get_bep(size_t len, struct intel_pt_pkt *packet)
324 packet->type = INTEL_PT_BEP;
328 static int intel_pt_get_bep_ip(size_t len, struct intel_pt_pkt *packet)
332 packet->type = INTEL_PT_BEP_IP;
337 struct intel_pt_pkt *packet)
343 return intel_pt_get_ptwrite(buf, len, packet);
347 return intel_pt_get_long_tnt(buf, len, packet);
349 return intel_pt_get_pip(buf, len, packet);
351 return intel_pt_get_tracestop(packet);
353 return intel_pt_get_cbr(buf, len, packet);
355 return intel_pt_get_vmcs(buf, len, packet);
357 return intel_pt_get_ovf(packet);
359 return intel_pt_get_psb(buf, len, packet);
361 return intel_pt_get_psbend(packet);
363 return intel_pt_get_tma(buf, len, packet);
365 return intel_pt_get_3byte(buf, len, packet);
367 return intel_pt_get_exstop(packet);
369 return intel_pt_get_exstop_ip(packet);
371 return intel_pt_get_mwait(buf, len, packet);
373 return intel_pt_get_pwre(buf, len, packet);
375 return intel_pt_get_pwrx(buf, len, packet);
377 return intel_pt_get_bbp(buf, len, packet);
379 return intel_pt_get_bep(len, packet);
381 return intel_pt_get_bep_ip(len, packet);
388 struct intel_pt_pkt *packet)
398 packet->type = INTEL_PT_TNT;
399 packet->count = count;
400 packet->payload = (uint64_t)byte << 57;
406 size_t len, struct intel_pt_pkt *packet)
422 packet->type = INTEL_PT_CYC;
423 packet->payload = payload;
429 struct intel_pt_pkt *packet)
433 packet->count = byte >> 5;
435 switch (packet->count) {
443 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 1));
449 packet->payload = le32_to_cpu(*(uint32_t *)(buf + 1));
456 memcpy_le64(&packet->payload, buf + 1, 6);
462 packet->payload = le64_to_cpu(*(uint64_t *)(buf + 1));
468 packet->type = type;
474 struct intel_pt_pkt *packet)
481 packet->type = INTEL_PT_MODE_EXEC;
484 packet->payload = 16;
487 packet->payload = 64;
490 packet->payload = 32;
497 packet->type = INTEL_PT_MODE_TSX;
500 packet->payload = buf[1] & 3;
510 struct intel_pt_pkt *packet)
514 packet->type = INTEL_PT_TSC;
515 memcpy_le64(&packet->payload, buf + 1, 7);
520 struct intel_pt_pkt *packet)
524 packet->type = INTEL_PT_MTC;
525 packet->payload = buf[1];
530 struct intel_pt_pkt *packet,
535 memset(packet, 0, sizeof(struct intel_pt_pkt));
547 return intel_pt_get_bip_4(buf, len, packet);
551 return intel_pt_get_bip_8(buf, len, packet);
559 return intel_pt_get_pad(packet);
561 return intel_pt_get_ext(buf, len, packet);
562 return intel_pt_get_short_tnt(byte, packet);
566 return intel_pt_get_cyc(byte, buf, len, packet);
570 return intel_pt_get_ip(INTEL_PT_TIP, byte, buf, len, packet);
573 packet);
576 packet);
578 return intel_pt_get_ip(INTEL_PT_FUP, byte, buf, len, packet);
582 return intel_pt_get_mode(buf, len, packet);
584 return intel_pt_get_tsc(buf, len, packet);
586 return intel_pt_get_mtc(buf, len, packet);
595 void intel_pt_upd_pkt_ctx(const struct intel_pt_pkt *packet,
598 switch (packet->type) {
634 if (packet->count)
645 struct intel_pt_pkt *packet, enum intel_pt_pkt_ctx *ctx)
649 ret = intel_pt_do_get_packet(buf, len, packet, *ctx);
653 intel_pt_upd_pkt_ctx(packet, ctx);
658 int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf,
662 unsigned long long payload = packet->payload;
663 const char *name = intel_pt_pkt_name(packet->type);
665 switch (packet->type) {
681 for (i = 0; i < packet->count; i++) {
692 ret = snprintf(buf, blen, " (%d)", packet->count);
702 if (!(packet->count))
714 (unsigned)payload, packet->count);
722 nr = packet->payload & NR_FLAG ? 1 : 0;
754 name, packet->count ? "4" : "8", payload);
757 name, packet->count, payload);
762 name, payload, packet->count);