mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 04/25] perf intel-pt: pkt-decoder: Add MODE.Exec IFLAG bit
Date: Mon, 24 Jan 2022 10:41:40 +0200	[thread overview]
Message-ID: <20220124084201.2699795-5-adrian.hunter@intel.com> (raw)
In-Reply-To: <20220124084201.2699795-1-adrian.hunter@intel.com>

As of Intel SDM (https://www.intel.com/sdm) version 076, there is a new
Intel PT feature called Event Trace which adds a bit to the existing
MODE.Exec packet to record the interrupt flag. Amend the packet decoder and
packet decoder test accordingly.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c   | 7 +++++--
 tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c | 4 +++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c b/tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c
index 0155215c1d41..42237656f453 100644
--- a/tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c
+++ b/tools/perf/arch/x86/tests/intel-pt-pkt-decoder-test.c
@@ -70,8 +70,11 @@ static struct test_data {
 	{8, {0x02, 0x43, 3, 4, 6, 8, 10, 12}, 0, {INTEL_PT_PIP, 0, 0xC0A08060403}, 0, 0 },
 	/* Mode Exec Packet */
 	{2, {0x99, 0x00}, 0, {INTEL_PT_MODE_EXEC, 0, 16}, 0, 0 },
-	{2, {0x99, 0x01}, 0, {INTEL_PT_MODE_EXEC, 0, 64}, 0, 0 },
-	{2, {0x99, 0x02}, 0, {INTEL_PT_MODE_EXEC, 0, 32}, 0, 0 },
+	{2, {0x99, 0x01}, 0, {INTEL_PT_MODE_EXEC, 1, 64}, 0, 0 },
+	{2, {0x99, 0x02}, 0, {INTEL_PT_MODE_EXEC, 2, 32}, 0, 0 },
+	{2, {0x99, 0x04}, 0, {INTEL_PT_MODE_EXEC, 4, 16}, 0, 0 },
+	{2, {0x99, 0x05}, 0, {INTEL_PT_MODE_EXEC, 5, 64}, 0, 0 },
+	{2, {0x99, 0x06}, 0, {INTEL_PT_MODE_EXEC, 6, 32}, 0, 0 },
 	/* Mode TSX Packet */
 	{2, {0x99, 0x20}, 0, {INTEL_PT_MODE_TSX, 0, 0}, 0, 0 },
 	{2, {0x99, 0x21}, 0, {INTEL_PT_MODE_TSX, 0, 1}, 0, 0 },
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
index 885174964c27..18f97f43e01a 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c
@@ -504,6 +504,7 @@ static int intel_pt_get_mode(const unsigned char *buf, size_t len,
 	switch (buf[1] >> 5) {
 	case 0:
 		packet->type = INTEL_PT_MODE_EXEC;
+		packet->count = buf[1];
 		switch (buf[1] & 3) {
 		case 0:
 			packet->payload = 16;
@@ -741,7 +742,8 @@ int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf,
 		return snprintf(buf, buf_len, "%s CTC 0x%x FC 0x%x", name,
 				(unsigned)payload, packet->count);
 	case INTEL_PT_MODE_EXEC:
-		return snprintf(buf, buf_len, "%s %lld", name, payload);
+		return snprintf(buf, buf_len, "%s IF:%d %lld",
+				name, !!(packet->count & 4), payload);
 	case INTEL_PT_MODE_TSX:
 		return snprintf(buf, buf_len, "%s TXAbort:%u InTX:%u",
 				name, (unsigned)(payload >> 1) & 1,
-- 
2.25.1


  parent reply	other threads:[~2022-01-24  8:42 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-24  8:41 [PATCH 00/25] perf intel-pt: Add support for Event Trace and TNT disable Adrian Hunter
2022-01-24  8:41 ` [PATCH 01/25] perf intel-pt: pkt-decoder-test: Fix scope of test_data Adrian Hunter
2022-01-24  8:41 ` [PATCH 02/25] perf intel-pt: pkt-decoder: Remove misplaced linebreak Adrian Hunter
2022-01-24  8:41 ` [PATCH 03/25] perf intel-pt: pkt-decoder: Add CFE and EVD packets Adrian Hunter
2022-01-24  8:41 ` Adrian Hunter [this message]
2022-01-24  8:41 ` [PATCH 05/25] perf intel-pt: decoder: Add config bit definitions Adrian Hunter
2022-01-24  8:41 ` [PATCH 06/25] perf intel-pt: decoder: Factor out clearing of FUP event variables Adrian Hunter
2022-01-24  8:41 ` [PATCH 07/25] perf intel-pt: decoder: Add CFE and EVD processing Adrian Hunter
2022-01-24  8:41 ` [PATCH 08/25] perf intel-pt: decoder: Add MODE.Exec IFLAG processing Adrian Hunter
2022-01-24  8:41 ` [PATCH 09/25] perf tools: Define Intel PT CFE / EVD event Adrian Hunter
2022-01-24  8:41 ` [PATCH 10/25] perf tools: Define Intel PT iflag synthesized event Adrian Hunter
2022-01-24  8:41 ` [PATCH 11/25] perf tools: Define new D and t flags Adrian Hunter
2022-01-24  8:41 ` [PATCH 12/25] perf auxtrace: Add itrace option "I" Adrian Hunter
2022-01-24  8:41 ` [PATCH 13/25] perf intel-pt: Record Event Trace capability flag Adrian Hunter
2022-01-24  8:41 ` [PATCH 14/25] perf intel-pt: Synthesize CFE / EVD event Adrian Hunter
2022-01-24  8:41 ` [PATCH 15/25] perf intel-pt: Synthesize iflag event Adrian Hunter
2022-01-24  8:41 ` [PATCH 16/25] perf intel-pt: Synthesize new D and t flags Adrian Hunter
2022-01-24  8:41 ` [PATCH 17/25] perf intel-pt: Force 'quick' mode when TNT is disabled Adrian Hunter
2022-01-24  8:41 ` [PATCH 18/25] perf script: Display Intel PT CFE / EVD synthesized event Adrian Hunter
2022-01-24  8:41 ` [PATCH 19/25] perf script: Display Intel PT iflag " Adrian Hunter
2022-01-24  8:41 ` [PATCH 20/25] perf script: Display new D and t flags Adrian Hunter
2022-01-24  8:41 ` [PATCH 21/25] perf scripts python: intel-pt-events.py: Add Event Trace Adrian Hunter
2022-01-24  8:41 ` [PATCH 22/25] perf scripting python: Add all sample flags to DB export Adrian Hunter
2022-01-24  8:41 ` [PATCH 23/25] perf scripts python: export-to-sqlite.py: Export all sample flags Adrian Hunter
2022-01-24  8:42 ` [PATCH 24/25] perf scripts python: export-to-postgresql.py: " Adrian Hunter
2022-01-24  8:42 ` [PATCH 25/25] perf intel-pt: Add documentation for Event Trace and TNT disable Adrian Hunter
2022-02-15 14:27 ` [PATCH 00/25] perf intel-pt: Add support " Arnaldo Carvalho de Melo
2022-02-15 19:39   ` Arnaldo Carvalho de Melo
2022-02-16  6:12     ` Adrian Hunter
2022-02-16  9:46       ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220124084201.2699795-5-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome