summaryrefslogtreecommitdiff
path: root/arch/x86/events/perf_event_flags.h
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2023-10-25 23:16:20 +0300
committerPeter Zijlstra <peterz@infradead.org>2023-10-27 16:05:09 +0300
commit85846b27072defc7ab3dcee7ff36563a040079dc (patch)
tree287c12b68fe5e265b16b874576af953d44c0a57f /arch/x86/events/perf_event_flags.h
parent571d91dcadfa3cef499010b4eddb9b58b0da4d24 (diff)
downloadlinux-85846b27072defc7ab3dcee7ff36563a040079dc.tar.xz
perf/x86: Add PERF_X86_EVENT_NEEDS_BRANCH_STACK flag
Currently, branch_sample_type !=0 is used to check whether a branch stack setup is required. But it doesn't check the sample type, unnecessary branch stack setup may be done for a counting event. E.g., perf record -e "{branch-instructions,branch-misses}:S" -j any Also, the event only with the new PERF_SAMPLE_BRANCH_COUNTERS branch sample type may not require a branch stack setup either. Add a new flag NEEDS_BRANCH_STACK to indicate whether the event requires a branch stack setup. Replace the needs_branch_stack() by checking the new flag. The counting event check is implemented here. The later patch will take the new PERF_SAMPLE_BRANCH_COUNTERS into account. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20231025201626.3000228-2-kan.liang@linux.intel.com
Diffstat (limited to 'arch/x86/events/perf_event_flags.h')
-rw-r--r--arch/x86/events/perf_event_flags.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/events/perf_event_flags.h b/arch/x86/events/perf_event_flags.h
index 1dc19b9b4426..a1685981c520 100644
--- a/arch/x86/events/perf_event_flags.h
+++ b/arch/x86/events/perf_event_flags.h
@@ -20,3 +20,4 @@ PERF_ARCH(TOPDOWN, 0x04000) /* Count Topdown slots/metrics events */
PERF_ARCH(PEBS_STLAT, 0x08000) /* st+stlat data address sampling */
PERF_ARCH(AMD_BRS, 0x10000) /* AMD Branch Sampling */
PERF_ARCH(PEBS_LAT_HYBRID, 0x20000) /* ld and st lat for hybrid */
+PERF_ARCH(NEEDS_BRANCH_STACK, 0x40000) /* require branch stack setup */