From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] perf tools: Ensure reserved member of PERF_SAMPLE_CPU is zero in perf_event__synthesize_sample()
Date: Tue, 16 Jan 2018 15:14:51 +0200 [thread overview]
Message-ID: <1516108492-21401-3-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1516108492-21401-1-git-send-email-adrian.hunter@intel.com>
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
next prev parent reply other threads:[~2018-01-16 13:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-16 13:14 [PATCH 0/3] perf tools: Get rid of unused 'swapped' parameter from perf_event__synthesize_sample() Adrian Hunter
2018-01-16 13:14 ` [PATCH 1/3] perf intel-pt/bts: Do not swap when synthesizing samples Adrian Hunter
2018-01-24 11:19 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-01-16 13:14 ` Adrian Hunter [this message]
2018-01-24 11:19 ` [tip:perf/core] perf evsel: Ensure reserved member of PERF_SAMPLE_CPU is zero in perf_event__synthesize_sample() tip-bot for Adrian Hunter
2018-01-16 13:14 ` [PATCH 3/3] perf tools: Get rid of unused 'swapped' parameter from perf_event__synthesize_sample() Adrian Hunter
2018-01-24 11:20 ` [tip:perf/core] " tip-bot for Adrian Hunter
2018-01-18 9:37 ` [PATCH 0/3] " Jiri Olsa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516108492-21401-3-git-send-email-adrian.hunter@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@kernel.org \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox