]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
perf_counter: Make pctrl() affect inherited counters too
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Mon, 25 May 2009 12:45:26 +0000 (14:45 +0200)
committerIngo Molnar <mingo@elte.hu>
Mon, 25 May 2009 12:55:00 +0000 (14:55 +0200)
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>
kernel/perf_counter.c

index 6cdf8248eda217b29edeef07ea408bbc9267f1e2..217dbcce2ebdb5d9026fcb5f32d48b414a3b8d90 100644 (file)
@@ -1067,30 +1067,6 @@ static void perf_counter_cpu_sched_in(struct perf_cpu_context *cpuctx, int cpu)
        __perf_counter_sched_in(ctx, cpuctx, cpu);
 }
 
-int perf_counter_task_enable(void)
-{
-       struct perf_counter *counter;
-
-       mutex_lock(&current->perf_counter_mutex);
-       list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
-               perf_counter_enable(counter);
-       mutex_unlock(&current->perf_counter_mutex);
-
-       return 0;
-}
-
-int perf_counter_task_disable(void)
-{
-       struct perf_counter *counter;
-
-       mutex_lock(&current->perf_counter_mutex);
-       list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
-               perf_counter_disable(counter);
-       mutex_unlock(&current->perf_counter_mutex);
-
-       return 0;
-}
-
 static void perf_log_period(struct perf_counter *counter, u64 period);
 
 static 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)
        return 0;
 }
 
+int perf_counter_task_enable(void)
+{
+       struct perf_counter *counter;
+
+       mutex_lock(&current->perf_counter_mutex);
+       list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
+               perf_counter_for_each_child(counter, perf_counter_enable);
+       mutex_unlock(&current->perf_counter_mutex);
+
+       return 0;
+}
+
+int perf_counter_task_disable(void)
+{
+       struct perf_counter *counter;
+
+       mutex_lock(&current->perf_counter_mutex);
+       list_for_each_entry(counter, &current->perf_counter_list, owner_entry)
+               perf_counter_for_each_child(counter, perf_counter_disable);
+       mutex_unlock(&current->perf_counter_mutex);
+
+       return 0;
+}
+
 /*
  * Callers need to ensure there can be no nesting of this function, otherwise
  * the seqlock logic goes bad. We can not serialize this because the arch