diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-02 00:46:13 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-02 00:46:13 (GMT) |
commit | 2e518181074b4ac67c27768f44a1515c4fc1bff9 (patch) | |
tree | 61fd9bdcc9bcbd0d90fead8975b93e359a5b6616 | |
parent | f72a209a3e694ecb8d3ceed4671d98c4364e00e3 (diff) | |
parent | 9d3ec7a0c41d010153c9d20577cb1bcf9c4f65df (diff) | |
download | linux-2e518181074b4ac67c27768f44a1515c4fc1bff9.tar.xz |
Merge branch 'perf-urgent-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip
* 'perf-urgent-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip:
perf tools: Fix raw sample reading
-rw-r--r-- | tools/perf/util/evsel.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index c5748c5..e389815 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -449,6 +449,8 @@ int perf_event__parse_sample(const union perf_event *event, u64 type, } if (type & PERF_SAMPLE_RAW) { + const u64 *pdata; + u.val64 = *array; if (WARN_ONCE(swapped, "Endianness of raw data not corrected!\n")) { @@ -462,11 +464,12 @@ int perf_event__parse_sample(const union perf_event *event, u64 type, return -EFAULT; data->raw_size = u.val32[0]; + pdata = (void *) array + sizeof(u32); - if (sample_overlap(event, &u.val32[1], data->raw_size)) + if (sample_overlap(event, pdata, data->raw_size)) return -EFAULT; - data->raw_data = &u.val32[1]; + data->raw_data = (void *) pdata; } return 0; |