lkml.org 
[lkml]   [2018]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] perf tools: Ensure reserved member of PERF_SAMPLE_CPU is zero in perf_event__synthesize_sample()
Date
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: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/util/evsel.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 8f971a2301d1..7d066e83abe8 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2523,6 +2523,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type,

if (type & PERF_SAMPLE_CPU) {
u.val32[0] = sample->cpu;
+ u.val32[1] = 0;
if (swapped) {
/*
* Inverse of what is done in perf_evsel__parse_sample
--
1.9.1
\
 
 \ /
  Last update: 2018-01-16 14:16    [W:0.065 / U:0.052 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site