]> git.baikalelectronics.ru Git - kernel.git/commit
perf tools: Fix bug in raw sample parsing
authorStephane Eranian <eranian@google.com>
Sat, 17 Mar 2012 22:23:18 +0000 (23:23 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 26 Mar 2012 18:36:03 +0000 (15:36 -0300)
commitd0fbf1b8390f9f970a9d947898358ceaf4f7a7b7
tree74d5b88c4821753e7cdfc501c9044f65d45294f6
parentb93917c220428b182a1106a9d9c95c35602cce43
perf tools: Fix bug in raw sample parsing

In perf_event__parse_sample(), the array variable was not incremented
by the amount of data used by the raw_data.

That was okay until we added PERF_SAMPLE_BRANCH_STACK which depends on
the array variable pointing to the beginning of the branch stack data.

But that was not the case if branch stack was combined with raw mode
sampling. That led to bogus branch stack addresses and count.

The bug would show up with:
$ perf record -R -b foo

This patch fixes the problem by correctly moving the array pointer
forward for RAW samples.

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120317222317.GA8803@quad
[ committer note: Fix also later submitted by Jiri Olsa ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c