mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
89d6c0b5bd
commit
4dc0da8696
12 changed files with 44 additions and 20 deletions
|
|
@ -79,7 +79,7 @@ static int op_create_counter(int cpu, int event)
|
|||
|
||||
pevent = perf_event_create_kernel_counter(&counter_config[event].attr,
|
||||
cpu, NULL,
|
||||
op_overflow_handler);
|
||||
op_overflow_handler, NULL);
|
||||
|
||||
if (IS_ERR(pevent))
|
||||
return PTR_ERR(pevent);
|
||||
|
|
|
|||
Loading…
Reference in a new issue