Lines Matching refs: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;
189 static int dump_packet(const struct intel_pt_pkt *packet, const u8 *bytes, int len)
199 ret = intel_pt_pkt_desc(packet, desc, INTEL_PT_PKT_DESC_MAX);
213 dump_packet(&d->packet, d->bytes, d->len);
216 static int fail(const struct test_data *d, struct intel_pt_pkt *packet, int len,
225 if (packet->type != d->packet.type)
227 d->packet.type, packet->type);
229 if (packet->count != d->packet.count)
231 d->packet.count, packet->count);
233 if (packet->payload != d->packet.payload)
235 (unsigned long long)d->packet.payload,
236 (unsigned long long)packet->payload);
239 pr_debug("Expected packet context: %d Decoded packet context %d\n",
245 static int test_ctx_unchanged(const struct test_data *d, struct intel_pt_pkt *packet,
250 intel_pt_upd_pkt_ctx(packet, &ctx);
263 struct intel_pt_pkt packet;
267 memset(&packet, 0xff, sizeof(packet));
269 /* Decode a packet */
270 ret = intel_pt_get_packet(d->bytes, d->len, &packet, &ctx);
277 /* Some packets must always leave the packet context unchanged */
281 err = test_ctx_unchanged(d, &packet, INTEL_PT_NO_CTX);
284 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_4_CTX);
287 err = test_ctx_unchanged(d, &packet, INTEL_PT_BLK_8_CTX);
293 if (ret != d->len || packet.type != d->packet.type ||
294 packet.count != d->packet.count ||
295 packet.payload != d->packet.payload || ctx != d->new_ctx)
296 return fail(d, &packet, ret, ctx);
299 ret = dump_packet(&d->packet, d->bytes, d->len);
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.