summaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-11-20 22:19:43 +0100
committerIngo Molnar <mingo@elte.hu>2009-11-21 14:11:35 +0100
commit453f19eea7dbad837425e9b07d84568d14898794 (patch)
tree3b1d757a72512b5ab566649b9eda59e032734993 /kernel/perf_event.c
parentef6ae724253429ac70d81e65d052f6a346d330bd (diff)
downloadlinux-453f19eea7dbad837425e9b07d84568d14898794.tar.bz2
perf: Allow for custom overflow handlers
in-kernel perf users might wish to have custom actions on the sample interrupt. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <20091120212508.222339539@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 3852e2656bb0..1dfb6cc4fdea 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3710,7 +3710,11 @@ static int __perf_event_overflow(struct perf_event *event, int nmi,
perf_event_disable(event);
}
- perf_event_output(event, nmi, data, regs);
+ if (event->overflow_handler)
+ event->overflow_handler(event, nmi, data, regs);
+ else
+ perf_event_output(event, nmi, data, regs);
+
return ret;
}
@@ -4836,6 +4840,8 @@ inherit_event(struct perf_event *parent_event,
if (parent_event->attr.freq)
child_event->hw.sample_period = parent_event->hw.sample_period;
+ child_event->overflow_handler = parent_event->overflow_handler;
+
/*
* Link it up in the child's context:
*/