summaryrefslogtreecommitdiff
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2023-10-25 23:16:21 +0300
committerPeter Zijlstra <peterz@infradead.org>2023-10-27 16:05:09 +0300
commit1f2376cd03dd3b965d130ed46a7c92769d614ba1 (patch)
tree60be778b77f2f089cf348afce0f701ffe22650be /include/linux/perf_event.h
parent85846b27072defc7ab3dcee7ff36563a040079dc (diff)
downloadlinux-1f2376cd03dd3b965d130ed46a7c92769d614ba1.tar.xz
perf: Add branch_sample_call_stack
Add a helper function to check call stack sample type. The later patch will invoke the function in several places. 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-3-kan.liang@linux.intel.com
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 7897ef066027..ac1a59c1f252 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1144,6 +1144,11 @@ static inline bool branch_sample_counters(const struct perf_event *event)
return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS;
}
+static inline bool branch_sample_call_stack(const struct perf_event *event)
+{
+ return event->attr.branch_sample_type & PERF_SAMPLE_BRANCH_CALL_STACK;
+}
+
struct perf_sample_data {
/*
* Fields set by perf_sample_data_init() unconditionally,