summaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorFranck Bui-Huu <fbuihuu@gmail.com>2010-11-23 16:21:43 +0100
committerIngo Molnar <mingo@elte.hu>2010-11-26 15:14:54 +0100
commit6c7e550f13f8ad82efb6a5653ae628c2543c1768 (patch)
tree1c994b999648fbe51ffe4312e2d6827aedd5f012 /include/linux/perf_event.h
parent35d3778a8fe3c8b4a7513565e34d3bde00ce43ec (diff)
perf: Introduce is_sampling_event()
and use it when appropriate. Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <1290525705-6265-1-git-send-email-fbuihuu@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
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 de2c41758e2..cbf04cc1e63 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -969,6 +969,11 @@ extern int perf_event_overflow(struct perf_event *event, int nmi,
struct perf_sample_data *data,
struct pt_regs *regs);
+static inline bool is_sampling_event(struct perf_event *event)
+{
+ return event->attr.sample_period != 0;
+}
+
/*
* Return 1 for a software event, 0 for a hardware event
*/