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 */
75 /* Mode TSX Packet */
79 /* Trace Stop Packet */
81 /* Core:Bus Ratio Packet */
83 /* Timestamp Counter Packet */
85 /* Mini Time Counter Packet */
87 /* TSC / MTC Alignment Packet */
92 /* Cycle Count Packet */
114 /* Virtual-Machine Control Structure Packet */
116 /* Overflow Packet */
120 /* Packet Stream Boundary*/
124 /* PSB End Packet */
126 /* Maintenance Packet */
128 /* Write Data to PT Packet */
133 /* Execution Stop Packet */
136 /* Monitor Wait Packet */
140 /* Power Entry Packet */
145 /* Power Exit Packet */
149 /* Block Begin Packet */
154 /* 4-byte Block Item Packet */
159 /* 8-byte Block Item Packet */
164 /* Block End Packet */
173 static int dump_packet(struct intel_pt_pkt *packet, u8 *bytes, int len) in dump_packet() argument
183 ret = intel_pt_pkt_desc(packet, desc, INTEL_PT_PKT_DESC_MAX); in dump_packet()
197 dump_packet(&d->packet, d->bytes, d->len); in decoding_failed()
200 static int fail(struct test_data *d, struct intel_pt_pkt *packet, int len, in fail() argument
209 if (packet->type != d->packet.type) in fail()
211 d->packet.type, packet->type); in fail()
213 if (packet->count != d->packet.count) in fail()
215 d->packet.count, packet->count); in fail()
217 if (packet->payload != d->packet.payload) in fail()
219 (unsigned long long)d->packet.payload, in fail()
220 (unsigned long long)packet->payload); in fail()
223 pr_debug("Expected packet context: %d Decoded packet context %d\n", in fail()
229 static int test_ctx_unchanged(struct test_data *d, struct intel_pt_pkt *packet, in test_ctx_unchanged() argument
234 intel_pt_upd_pkt_ctx(packet, &ctx); in test_ctx_unchanged()
238 pr_debug("Packet context changed!\n"); in test_ctx_unchanged()
247 struct intel_pt_pkt packet; in test_one() local
251 memset(&packet, 0xff, sizeof(packet)); in test_one()
253 /* Decode a packet */ in test_one()
254 ret = intel_pt_get_packet(d->bytes, d->len, &packet, &ctx); in test_one()
261 /* Some packets must always leave the packet context unchanged */ in test_one()
265 err = test_ctx_unchanged(d, &packet, INTEL_PT_NO_CTX); in test_one()
268 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_4_CTX); in test_one()
271 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_8_CTX); in test_one()
277 if (ret != d->len || packet.type != d->packet.type || in test_one()
278 packet.count != d->packet.count || in test_one()
279 packet.payload != d->packet.payload || ctx != d->new_ctx) in test_one()
280 return fail(d, &packet, ret, ctx); in test_one()
283 ret = dump_packet(&d->packet, d->bytes, d->len); in test_one()
289 * This test feeds byte sequences to the Intel PT packet decoder and checks the
290 * results. Changes to the packet context are also checked.