aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-08-06 14:57:41 -0400
committerIngo Molnar <mingo@elte.hu>2009-08-09 06:54:34 -0400
commit1c222bce7dd0cb9578b4c5cd3874a74f1db497c3 (patch)
tree51c8263de9d6e7480df56646ca4654e2a7d6f42b /tools
parent1953287bfe8afcbbd235bd6c42c9df06d52438dc (diff)
perf tools: Fix multi-counter stat bug caused by incorrect reading of perf.data file header
Brice Goglin reported that only the first result from a multi-counter perf record --stat run is accurate, the rest looks bogus. A silly mistake made us re-read the first attribute for every recorded attribute. 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> Cc: paulus@samba.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/header.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 450384b3bbe5..95a44bcfc2dc 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -213,9 +213,10 @@ struct perf_header *perf_header__read(int fd)
213 213
214 for (i = 0; i < nr_attrs; i++) { 214 for (i = 0; i < nr_attrs; i++) {
215 struct perf_header_attr *attr; 215 struct perf_header_attr *attr;
216 off_t tmp = lseek(fd, 0, SEEK_CUR); 216 off_t tmp;
217 217
218 do_read(fd, &f_attr, sizeof(f_attr)); 218 do_read(fd, &f_attr, sizeof(f_attr));
219 tmp = lseek(fd, 0, SEEK_CUR);
219 220
220 attr = perf_header_attr__new(&f_attr.attr); 221 attr = perf_header_attr__new(&f_attr.attr);
221 222