aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_counter.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-05-25 08:45:26 -0400
committerIngo Molnar <mingo@elte.hu>2009-05-25 08:55:00 -0400
commit771d7cde144d87f2d1fbee4da3c6234d61f7e42a (patch)
tree21d15c924924b5f6cb91dd2b103337253b46ed58 /kernel/perf_counter.c
parente527ea312f31e88a7fa5472b71db71c565b0d44f (diff)
perf_counter: Make pctrl() affect inherited counters too
Paul noted that the new ptcrl() didn't work on child counters. Reported-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: John Kacur <jkacur@redhat.com> LKML-Reference: <20090525124600.203151469@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r--kernel/perf_counter.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 6cdf8248eda2..217dbcce2ebd 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -1067,30 +1067,6 @@ static void perf_counter_cpu_sched_in(struct perf_cpu_context *cpuctx, int cpu)
1067 __perf_counter_sched_in(ctx, cpuctx, cpu); 1067 __perf_counter_sched_in(ctx, cpuctx, cpu);
1068} 1068}
1069 1069
1070int perf_counter_task_enable(void)
1071{
1072 struct perf_counter *counter;
1073
1074 mutex_lock(&current->perf_counter_mutex);
1075 list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
1076 perf_counter_enable(counter);
1077 mutex_unlock(&current->perf_counter_mutex);
1078
1079 return 0;
1080}
1081
1082int perf_counter_task_disable(void)
1083{
1084 struct perf_counter *counter;
1085
1086 mutex_lock(&current->perf_counter_mutex);
1087 list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
1088 perf_counter_disable(counter);
1089 mutex_unlock(&current->perf_counter_mutex);
1090
1091 return 0;
1092}
1093
1094static void perf_log_period(struct perf_counter *counter, u64 period); 1070static void perf_log_period(struct perf_counter *counter, u64 period);
1095 1071
1096static void perf_adjust_freq(struct perf_counter_context *ctx) 1072static void perf_adjust_freq(struct perf_counter_context *ctx)
@@ -1505,6 +1481,30 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1505 return 0; 1481 return 0;
1506} 1482}
1507 1483
1484int perf_counter_task_enable(void)
1485{
1486 struct perf_counter *counter;
1487
1488 mutex_lock(&current->perf_counter_mutex);
1489 list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
1490 perf_counter_for_each_child(counter, perf_counter_enable);
1491 mutex_unlock(&current->perf_counter_mutex);
1492
1493 return 0;
1494}
1495
1496int perf_counter_task_disable(void)
1497{
1498 struct perf_counter *counter;
1499
1500 mutex_lock(&current->perf_counter_mutex);
1501 list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
1502 perf_counter_for_each_child(counter, perf_counter_disable);
1503 mutex_unlock(&current->perf_counter_mutex);
1504
1505 return 0;
1506}
1507
1508/* 1508/*
1509 * Callers need to ensure there can be no nesting of this function, otherwise 1509 * Callers need to ensure there can be no nesting of this function, otherwise
1510 * the seqlock logic goes bad. We can not serialize this because the arch 1510 * the seqlock logic goes bad. We can not serialize this because the arch