mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
perfcounters: use hw_event.disable flag
Impact: implement default-off counters Make sure that counters that are created with counter.hw_event.disabled=1, get created in disabled state. They can be enabled via: prctl(PR_TASK_PERF_COUNTERS_ENABLE); Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
parent
f65cb45cba
commit
a86ed50859
1 changed files with 3 additions and 0 deletions
|
@ -1093,6 +1093,9 @@ perf_counter_alloc(struct perf_counter_hw_event *hw_event,
|
|||
counter->group_leader = group_leader;
|
||||
counter->hw_ops = NULL;
|
||||
|
||||
if (hw_event->disabled)
|
||||
counter->state = PERF_COUNTER_STATE_OFF;
|
||||
|
||||
hw_ops = NULL;
|
||||
if (!hw_event->raw && hw_event->type < 0)
|
||||
hw_ops = sw_perf_counter_init(counter);
|
||||
|
|
Loading…
Reference in a new issue