aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-16 18:43:10 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-16 19:02:21 -0500
commita86ed50859d65a08beec9474df97b88438a996df (patch)
tree355cd6dcbba43662e2db925c25cedeaa27286bbb /kernel
parentf65cb45cba63f249458b669aa67069eabc37b2f5 (diff)
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 'kernel')
-rw-r--r--kernel/perf_counter.c3
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,
1093 counter->group_leader = group_leader; 1093 counter->group_leader = group_leader;
1094 counter->hw_ops = NULL; 1094 counter->hw_ops = NULL;
1095 1095
1096 if (hw_event->disabled)
1097 counter->state = PERF_COUNTER_STATE_OFF;
1098
1096 hw_ops = NULL; 1099 hw_ops = NULL;
1097 if (!hw_event->raw && hw_event->type < 0) 1100 if (!hw_event->raw && hw_event->type < 0)
1098 hw_ops = sw_perf_counter_init(counter); 1101 hw_ops = sw_perf_counter_init(counter);