[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-914e406e7b27cea336d3dfc12daa75930edd88a6@git.kernel.org>
Date: Thu, 6 Aug 2009 17:58:00 GMT
From: tip-bot for Peter Zijlstra <peterz@...radead.org>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, Brice.Goglin@...ia.fr, hpa@...or.com,
mingo@...hat.com, a.p.zijlstra@...llo.nl, peterz@...radead.org,
tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perfcounters/urgent] perf_counter: Fix double list iteration in per task precise stats
Commit-ID: 914e406e7b27cea336d3dfc12daa75930edd88a6
Gitweb: http://git.kernel.org/tip/914e406e7b27cea336d3dfc12daa75930edd88a6
Author: Peter Zijlstra <peterz@...radead.org>
AuthorDate: Thu, 6 Aug 2009 18:06:26 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 6 Aug 2009 19:54:17 +0200
perf_counter: Fix double list iteration in per task precise stats
Brice Goglin reported:
> 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@...ia.fr>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Tested-by: Brice Goglin <Brice.Goglin@...ia.fr>
LKML-Reference: <1249574786.32113.550.camel@...ns>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/perf_counter.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 199ed47..673c1aa 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,
__perf_counter_sync_stat(counter, next_counter);
counter = list_next_entry(counter, event_entry);
- next_counter = list_next_entry(counter, event_entry);
+ next_counter = list_next_entry(next_counter, event_entry);
}
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists