Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reviewed-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Link: https://lore.kernel.org/r/20250304111240.3378214-5-leo.yan@arm.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Leo Yan and committed by
Namhyung Kim
4caa9710 88b14731

+5 -2
+4 -2
tools/perf/util/event.h
··· 67 67 PERF_IP_FLAG_INTR_DISABLE = 1ULL << 13, 68 68 PERF_IP_FLAG_INTR_TOGGLE = 1ULL << 14, 69 69 PERF_IP_FLAG_BRANCH_MISS = 1ULL << 15, 70 + PERF_IP_FLAG_NOT_TAKEN = 1ULL << 16, 70 71 }; 71 72 72 - #define PERF_IP_FLAG_CHARS "bcrosyiABExghDtm" 73 + #define PERF_IP_FLAG_CHARS "bcrosyiABExghDtmn" 73 74 74 75 #define PERF_ADDITIONAL_STATE_MASK \ 75 76 (PERF_IP_FLAG_IN_TX | \ ··· 92 91 PERF_IP_FLAG_VMEXIT) 93 92 94 93 #define PERF_IP_FLAG_BRACH_EVENT_MASK \ 95 - PERF_IP_FLAG_BRANCH_MISS 94 + (PERF_IP_FLAG_BRANCH_MISS | \ 95 + PERF_IP_FLAG_NOT_TAKEN) 96 96 97 97 #define PERF_MEM_DATA_SRC_NONE \ 98 98 (PERF_MEM_S(OP, NA) |\
+1
tools/perf/util/trace-event-scripting.c
··· 317 317 const char *name; 318 318 } branch_events[] = { 319 319 {PERF_IP_FLAG_BRANCH_MISS, "miss"}, 320 + {PERF_IP_FLAG_NOT_TAKEN, "not_taken"}, 320 321 {0, NULL} 321 322 }; 322 323