diff options
author | Avi Kivity <avi@redhat.com> | 2011-06-29 18:42:35 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-07-01 11:06:38 +0200 |
commit | 4dc0da86967d5463708631d02a70cfed5b104884 (patch) | |
tree | e09071a62f2457b710ff69df3be1bff39340a4c6 /arch/arm/kernel/ptrace.c | |
parent | 89d6c0b5bdbb1927775584dcf532d98b3efe1477 (diff) | |
download | blackbird-op-linux-4dc0da86967d5463708631d02a70cfed5b104884.tar.gz blackbird-op-linux-4dc0da86967d5463708631d02a70cfed5b104884.zip |
perf: Add context field to perf_event
The perf_event overflow handler does not receive any caller-derived
argument, so many callers need to resort to looking up the perf_event
in their local data structure. This is ugly and doesn't scale if a
single callback services many perf_events.
Fix by adding a context parameter to perf_event_create_kernel_counter()
(and derived hardware breakpoints APIs) and storing it in the perf_event.
The field can be accessed from the callback as event->overflow_handler_context.
All callers are updated.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1309362157-6596-2-git-send-email-avi@redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/arm/kernel/ptrace.c')
-rw-r--r-- | arch/arm/kernel/ptrace.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index 0c9b1054f790..5c199610719f 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c @@ -479,7 +479,8 @@ static struct perf_event *ptrace_hbp_create(struct task_struct *tsk, int type) attr.bp_type = type; attr.disabled = 1; - return register_user_hw_breakpoint(&attr, ptrace_hbptriggered, tsk); + return register_user_hw_breakpoint(&attr, ptrace_hbptriggered, NULL, + tsk); } static int ptrace_gethbpregs(struct task_struct *tsk, long num, |