hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.h
....@@ -1,16 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * intel_pt_pkt_decoder.h: Intel Processor Trace support
34 * Copyright (c) 2013-2014, Intel Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
145 */
156
167 #ifndef INCLUDE__INTEL_PT_PKT_DECODER_H__
....@@ -59,6 +50,10 @@
5950 INTEL_PT_MWAIT,
6051 INTEL_PT_PWRE,
6152 INTEL_PT_PWRX,
53
+ INTEL_PT_BBP,
54
+ INTEL_PT_BIP,
55
+ INTEL_PT_BEP,
56
+ INTEL_PT_BEP_IP,
6257 };
6358
6459 struct intel_pt_pkt {
....@@ -67,10 +62,25 @@
6762 uint64_t payload;
6863 };
6964
65
+/*
66
+ * Decoding of BIP packets conflicts with single-byte TNT packets. Since BIP
67
+ * packets only occur in the context of a block (i.e. between BBP and BEP), that
68
+ * context must be recorded and passed to the packet decoder.
69
+ */
70
+enum intel_pt_pkt_ctx {
71
+ INTEL_PT_NO_CTX, /* BIP packets are invalid */
72
+ INTEL_PT_BLK_4_CTX, /* 4-byte BIP packets */
73
+ INTEL_PT_BLK_8_CTX, /* 8-byte BIP packets */
74
+};
75
+
7076 const char *intel_pt_pkt_name(enum intel_pt_pkt_type);
7177
7278 int intel_pt_get_packet(const unsigned char *buf, size_t len,
73
- struct intel_pt_pkt *packet);
79
+ struct intel_pt_pkt *packet,
80
+ enum intel_pt_pkt_ctx *ctx);
81
+
82
+void intel_pt_upd_pkt_ctx(const struct intel_pt_pkt *packet,
83
+ enum intel_pt_pkt_ctx *ctx);
7484
7585 int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, size_t len);
7686