提交 1c222bce 编写于 作者: P Peter Zijlstra 提交者: Ingo Molnar

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: NBrice Goglin <Brice.Goglin@inria.fr>
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: NBrice Goglin <Brice.Goglin@inria.fr>
Cc: paulus@samba.org
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 1953287b
......@@ -213,9 +213,10 @@ struct perf_header *perf_header__read(int fd)
for (i = 0; i < nr_attrs; i++) {
struct perf_header_attr *attr;
off_t tmp = lseek(fd, 0, SEEK_CUR);
off_t tmp;
do_read(fd, &f_attr, sizeof(f_attr));
tmp = lseek(fd, 0, SEEK_CUR);
attr = perf_header_attr__new(&f_attr.attr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册