[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250205121555.180606-5-leo.yan@arm.com>
Date: Wed, 5 Feb 2025 12:15:48 +0000
From: Leo Yan <leo.yan@....com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>,
John Garry <john.g.garry@...cle.com>,
Will Deacon <will@...nel.org>,
James Clark <james.clark@...aro.org>,
Mike Leach <mike.leach@...aro.org>,
linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Graham Woodward <graham.woodward@....com>
Cc: Leo Yan <leo.yan@....com>
Subject: [PATCH v1 04/11] perf script: Add not taken event for branches
Some hardware (e.g., Arm SPE) can trace the not taken event for
branches. Add a flag for this event and support printing it.
Signed-off-by: Leo Yan <leo.yan@....com>
---
tools/perf/util/event.h | 6 ++++--
tools/perf/util/trace-event-scripting.c | 1 +
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 962fbc1714cf..c7f4b4b841ca 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -67,9 +67,10 @@ enum {
PERF_IP_FLAG_INTR_DISABLE = 1ULL << 13,
PERF_IP_FLAG_INTR_TOGGLE = 1ULL << 14,
PERF_IP_FLAG_BRANCH_MISS = 1ULL << 15,
+ PERF_IP_FLAG_NOT_TAKEN = 1ULL << 16,
};
-#define PERF_IP_FLAG_CHARS "bcrosyiABExghDtm"
+#define PERF_IP_FLAG_CHARS "bcrosyiABExghDtmn"
#define PERF_ADDITIONAL_STATE_MASK \
(PERF_IP_FLAG_IN_TX | \
@@ -91,7 +92,8 @@ enum {
PERF_IP_FLAG_VMEXIT)
#define PERF_IP_FLAG_BRACH_EVENT_MASK \
- PERF_IP_FLAG_BRANCH_MISS
+ (PERF_IP_FLAG_BRANCH_MISS | \
+ PERF_IP_FLAG_NOT_TAKEN)
#define PERF_MEM_DATA_SRC_NONE \
(PERF_MEM_S(OP, NA) |\
diff --git a/tools/perf/util/trace-event-scripting.c b/tools/perf/util/trace-event-scripting.c
index 55d7e4e612d5..29cc467be14a 100644
--- a/tools/perf/util/trace-event-scripting.c
+++ b/tools/perf/util/trace-event-scripting.c
@@ -317,6 +317,7 @@ static const struct {
const char *name;
} branch_events[] = {
{PERF_IP_FLAG_BRANCH_MISS, "miss"},
+ {PERF_IP_FLAG_NOT_TAKEN, "not_taken"},
{0, NULL}
};
--
2.34.1
Powered by blists - more mailing lists