diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-10-18 15:33:50 +0200 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-11-03 19:11:53 +0100 |
commit | 97eaf5300b9d0cd99c310bf8c4a0f2f3296d88a3 (patch) | |
tree | aa047f4c078e2c9aeabcbcc9e33d93a50366b8e9 /include/linux/perf_event.h | |
parent | 41a48d14f6991020c9bb6b93e289ca5b411ed09a (diff) | |
download | kernel_samsung_aries-97eaf5300b9d0cd99c310bf8c4a0f2f3296d88a3.zip kernel_samsung_aries-97eaf5300b9d0cd99c310bf8c4a0f2f3296d88a3.tar.gz kernel_samsung_aries-97eaf5300b9d0cd99c310bf8c4a0f2f3296d88a3.tar.bz2 |
perf/core: Add a callback to perf events
A simple callback in a perf event can be used for multiple purposes.
For example it is useful for triggered based events like hardware
breakpoints that need a callback to dispatch a triggered breakpoint
event.
v2: Simplify a bit the callback attribution as suggested by Paul
Mackerras
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "K.Prasad" <prasad@linux.vnet.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r-- | include/linux/perf_event.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index fa151d4..8d54e6d 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -544,6 +544,8 @@ struct perf_pending_entry { void (*func)(struct perf_pending_entry *); }; +typedef void (*perf_callback_t)(struct perf_event *, void *); + /** * struct perf_event - performance event kernel representation: */ @@ -639,6 +641,8 @@ struct perf_event { struct event_filter *filter; #endif + perf_callback_t callback; + #endif /* CONFIG_PERF_EVENTS */ }; @@ -748,7 +752,8 @@ extern int perf_event_release_kernel(struct perf_event *event); extern struct perf_event * perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, - pid_t pid); + pid_t pid, + perf_callback_t callback); extern u64 perf_event_read_value(struct perf_event *event); struct perf_sample_data { |