Lines Matching full:packet

15  * @ctx: packet context to decode
16 * @packet: expected packet
17 * @new_ctx: expected new packet context
18 * @ctx_unchanged: the packet context must not change
24 struct intel_pt_pkt packet; member
28 /* Padding Packet */
30 /* Short Taken/Not Taken Packet */
35 /* Long Taken/Not Taken Packet */
40 /* Target IP Packet */
47 /* Packet Generation Enable */
54 /* Packet Generation Disable */
61 /* Flow Update Packet */
68 /* Paging Information Packet */
71 /* Mode Exec Packet */
78 /* Mode TSX Packet */
82 /* Trace Stop Packet */
84 /* Core:Bus Ratio Packet */
86 /* Timestamp Counter Packet */
88 /* Mini Time Counter Packet */
90 /* TSC / MTC Alignment Packet */
95 /* Cycle Count Packet */
117 /* Virtual-Machine Control Structure Packet */
119 /* Overflow Packet */
123 /* Packet Stream Boundary*/
127 /* PSB End Packet */
129 /* Maintenance Packet */
131 /* Write Data to PT Packet */
136 /* Execution Stop Packet */
139 /* Monitor Wait Packet */
143 /* Power Entry Packet */
148 /* Power Exit Packet */
152 /* Block Begin Packet */
157 /* 4-byte Block Item Packet */
162 /* 8-byte Block Item Packet */
167 /* Block End Packet */
172 /* Control Flow Event Packet */
184 static int dump_packet(struct intel_pt_pkt *packet, u8 *bytes, int len) in dump_packet() argument
194 ret = intel_pt_pkt_desc(packet, desc, INTEL_PT_PKT_DESC_MAX); in dump_packet()
208 dump_packet(&d->packet, d->bytes, d->len); in decoding_failed()
211 static int fail(struct test_data *d, struct intel_pt_pkt *packet, int len, in fail() argument
220 if (packet->type != d->packet.type) in fail()
222 d->packet.type, packet->type); in fail()
224 if (packet->count != d->packet.count) in fail()
226 d->packet.count, packet->count); in fail()
228 if (packet->payload != d->packet.payload) in fail()
230 (unsigned long long)d->packet.payload, in fail()
231 (unsigned long long)packet->payload); in fail()
234 pr_debug("Expected packet context: %d Decoded packet context %d\n", in fail()
240 static int test_ctx_unchanged(struct test_data *d, struct intel_pt_pkt *packet, in test_ctx_unchanged() argument
245 intel_pt_upd_pkt_ctx(packet, &ctx); in test_ctx_unchanged()
249 pr_debug("Packet context changed!\n"); in test_ctx_unchanged()
258 struct intel_pt_pkt packet; in test_one() local
262 memset(&packet, 0xff, sizeof(packet)); in test_one()
264 /* Decode a packet */ in test_one()
265 ret = intel_pt_get_packet(d->bytes, d->len, &packet, &ctx); in test_one()
272 /* Some packets must always leave the packet context unchanged */ in test_one()
276 err = test_ctx_unchanged(d, &packet, INTEL_PT_NO_CTX); in test_one()
279 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_4_CTX); in test_one()
282 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_8_CTX); in test_one()
288 if (ret != d->len || packet.type != d->packet.type || in test_one()
289 packet.count != d->packet.count || in test_one()
290 packet.payload != d->packet.payload || ctx != d->new_ctx) in test_one()
291 return fail(d, &packet, ret, ctx); in test_one()
294 ret = dump_packet(&d->packet, d->bytes, d->len); in test_one()
300 * This test feeds byte sequences to the Intel PT packet decoder and checks the
301 * results. Changes to the packet context are also checked.