Commit 59a87fda authored by Adrian Hunter's avatar Adrian Hunter Committed by Arnaldo Carvalho de Melo

perf evsel: Ensure reserved member of PERF_SAMPLE_CPU is zero in perf_event__synthesize_sample()

PERF_SAMPLE_CPU contains the cpu number in the first 4 bytes and the
second 4 bytes are reserved. Ensure the reserved bytes are zero in
perf_event__synthesize_sample().
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Acked-by: default avatarJiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1516108492-21401-3-git-send-email-adrian.hunter@intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a10eb530
...@@ -2533,6 +2533,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, ...@@ -2533,6 +2533,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,
if (type & PERF_SAMPLE_CPU) { if (type & PERF_SAMPLE_CPU) {
u.val32[0] = sample->cpu; u.val32[0] = sample->cpu;
u.val32[1] = 0;
if (swapped) { if (swapped) {
/* /*
* Inverse of what is done in perf_evsel__parse_sample * Inverse of what is done in perf_evsel__parse_sample
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment