Lines Matching full:packet

20  * @ctx: packet context to decode
21 * @packet: expected packet
22 * @new_ctx: expected new packet context
23 * @ctx_unchanged: the packet context must not change
29 struct intel_pt_pkt packet; member
33 /* Padding Packet */
35 /* Short Taken/Not Taken Packet */
40 /* Long Taken/Not Taken Packet */
45 /* Target IP Packet */
52 /* Packet Generation Enable */
59 /* Packet Generation Disable */
66 /* Flow Update Packet */
73 /* Paging Information Packet */
76 /* Mode Exec Packet */
83 /* Mode TSX Packet */
87 /* Trace Stop Packet */
89 /* Core:Bus Ratio Packet */
91 /* Timestamp Counter Packet */
93 /* Mini Time Counter Packet */
95 /* TSC / MTC Alignment Packet */
100 /* Cycle Count Packet */
122 /* Virtual-Machine Control Structure Packet */
124 /* Overflow Packet */
128 /* Packet Stream Boundary*/
132 /* PSB End Packet */
134 /* Maintenance Packet */
136 /* Write Data to PT Packet */
141 /* Execution Stop Packet */
144 /* Monitor Wait Packet */
148 /* Power Entry Packet */
153 /* Power Exit Packet */
157 /* Block Begin Packet */
162 /* 4-byte Block Item Packet */
167 /* 8-byte Block Item Packet */
172 /* Block End Packet */
177 /* Control Flow Event Packet */
189 static int dump_packet(const struct intel_pt_pkt *packet, const u8 *bytes, int len) in dump_packet() argument
199 ret = intel_pt_pkt_desc(packet, desc, INTEL_PT_PKT_DESC_MAX); in dump_packet()
213 dump_packet(&d->packet, d->bytes, d->len); in decoding_failed()
216 static int fail(const struct test_data *d, struct intel_pt_pkt *packet, int len, in fail() argument
225 if (packet->type != d->packet.type) in fail()
227 d->packet.type, packet->type); in fail()
229 if (packet->count != d->packet.count) in fail()
231 d->packet.count, packet->count); in fail()
233 if (packet->payload != d->packet.payload) in fail()
235 (unsigned long long)d->packet.payload, in fail()
236 (unsigned long long)packet->payload); in fail()
239 pr_debug("Expected packet context: %d Decoded packet context %d\n", in fail()
245 static int test_ctx_unchanged(const struct test_data *d, struct intel_pt_pkt *packet, in test_ctx_unchanged() argument
250 intel_pt_upd_pkt_ctx(packet, &ctx); in test_ctx_unchanged()
254 pr_debug("Packet context changed!\n"); in test_ctx_unchanged()
263 struct intel_pt_pkt packet; in test_one() local
267 memset(&packet, 0xff, sizeof(packet)); in test_one()
269 /* Decode a packet */ in test_one()
270 ret = intel_pt_get_packet(d->bytes, d->len, &packet, &ctx); in test_one()
277 /* Some packets must always leave the packet context unchanged */ in test_one()
281 err = test_ctx_unchanged(d, &packet, INTEL_PT_NO_CTX); in test_one()
284 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_4_CTX); in test_one()
287 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_8_CTX); in test_one()
293 if (ret != d->len || packet.type != d->packet.type || in test_one()
294 packet.count != d->packet.count || in test_one()
295 packet.payload != d->packet.payload || ctx != d->new_ctx) in test_one()
296 return fail(d, &packet, ret, ctx); in test_one()
299 ret = dump_packet(&d->packet, d->bytes, d->len); in test_one()
305 * This test feeds byte sequences to the Intel PT packet decoder and checks the
306 * results. Changes to the packet context are also checked.