aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2009-08-06 12:06:26 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-06 14:25:18 -0400
commit1054598cab8674438675085fae459e960eb10799 (patch)
tree9dcf2c60080e8275bded902f7a08ebcd8140dfcc /kernel
parent9424edc2da097c8589fcc24a72552d33e54be161 (diff)
perf_counter: Fix double list iteration in per task precise stats
Brice Goglin reported this crash with per task precise stats: > I finally managed to test the threaded perfcounter statistics (thanks a > lot for implementing it). I am running 2.6.31-rc5 (with the AMD > magny-cours patches but I don't think they matter here). I am trying to > measure local/remote memory accesses per thread during the well-known > stream benchmark. It's compiled with OpenMP using 16 threads on a > quad-socket quad-core barcelona machine. > > Command line is: > /mnt/scratch/bgoglin/cpunode/linux-2.6.31/tools/perf/perf record -f -s > -e r1000001e0 -e r1000002e0 -e r1000004e0 -e r1000008e0 ./stream > > It seems to work fine with a single -e <counter> on the command line > while it crashes when there are at least 2 of them. > It seems to work fine without -s as well. A silly copy-paste resulted in a messed up iteration which would cause the OOPS. Reported-by: Brice Goglin <Brice.Goglin@inria.fr> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Tested-by: Brice Goglin <Brice.Goglin@inria.fr> LKML-Reference: <1249574786.32113.550.camel@twins> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/perf_counter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 199ed4771315..673c1aaf7332 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -1104,7 +1104,7 @@ static void perf_counter_sync_stat(struct perf_counter_context *ctx,
1104 __perf_counter_sync_stat(counter, next_counter); 1104 __perf_counter_sync_stat(counter, next_counter);
1105 1105
1106 counter = list_next_entry(counter, event_entry); 1106 counter = list_next_entry(counter, event_entry);
1107 next_counter = list_next_entry(counter, event_entry); 1107 next_counter = list_next_entry(next_counter, event_entry);
1108 } 1108 }
1109} 1109}
1110 1110