diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-12-17 00:43:10 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-12-17 01:02:21 +0100 |
commit | a86ed50859d65a08beec9474df97b88438a996df (patch) | |
tree | 355cd6dcbba43662e2db925c25cedeaa27286bbb /kernel/perf_counter.c | |
parent | perfcounters: flush on setuid exec (diff) | |
download | linux-a86ed50859d65a08beec9474df97b88438a996df.tar.xz linux-a86ed50859d65a08beec9474df97b88438a996df.zip |
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>
Diffstat (limited to '')
-rw-r--r-- | kernel/perf_counter.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 16396e9406fa..5431e790b5d6 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c @@ -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); |