lkml.org 
[lkml]   [2011]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[GIT PULL] perf fix
Linus,

Please pull the latest perf-urgent-for-linus git tree from:

git://tesla.tglx.de/git/linux-2.6-tip.git perf-urgent-for-linus

Thanks,

Ingo

------------------>
Jiri Olsa (1):
perf tools: Fix raw sample reading

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;

\
 
 \ /
  Last update: 2011-10-01 09:55    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean