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>
Showing
- arch/arm/kernel/ptrace.c 2 additions, 1 deletionarch/arm/kernel/ptrace.c
- arch/powerpc/kernel/ptrace.c 1 addition, 1 deletionarch/powerpc/kernel/ptrace.c
- arch/sh/kernel/ptrace_32.c 2 additions, 1 deletionarch/sh/kernel/ptrace_32.c
- arch/x86/kernel/kgdb.c 1 addition, 1 deletionarch/x86/kernel/kgdb.c
- arch/x86/kernel/ptrace.c 2 additions, 1 deletionarch/x86/kernel/ptrace.c
- drivers/oprofile/oprofile_perf.c 1 addition, 1 deletiondrivers/oprofile/oprofile_perf.c
- include/linux/hw_breakpoint.h 8 additions, 2 deletionsinclude/linux/hw_breakpoint.h
- include/linux/perf_event.h 3 additions, 1 deletioninclude/linux/perf_event.h
- kernel/events/core.c 15 additions, 6 deletionskernel/events/core.c
- kernel/events/hw_breakpoint.c 7 additions, 3 deletionskernel/events/hw_breakpoint.c
- kernel/watchdog.c 1 addition, 1 deletionkernel/watchdog.c
- samples/hw_breakpoint/data_breakpoint.c 1 addition, 1 deletionsamples/hw_breakpoint/data_breakpoint.c
Loading
Please register or sign in to comment