public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, adrian.hunter@intel.com, acme@redhat.com,
	hpa@zytor.com, linux-kernel@vger.kernel.org, tglx@linutronix.de,
	jolsa@redhat.com
Subject: [tip:perf/core] perf evsel: Ensure reserved member of PERF_SAMPLE_CPU is zero in perf_event__synthesize_sample()
Date: Wed, 24 Jan 2018 03:19:42 -0800	[thread overview]
Message-ID: <tip-59a87fdad1467d228acc5cb1303b0b568a9e86a8@git.kernel.org> (raw)
In-Reply-To: <1516108492-21401-3-git-send-email-adrian.hunter@intel.com>

Commit-ID:  59a87fdad1467d228acc5cb1303b0b568a9e86a8
Gitweb:     https://git.kernel.org/tip/59a87fdad1467d228acc5cb1303b0b568a9e86a8
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Tue, 16 Jan 2018 15:14:51 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 18 Jan 2018 09:00:45 -0300

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: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1516108492-21401-3-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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 85eb84d..4403267 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2533,6 +2533,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

  reply	other threads:[~2018-01-24 11:20 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 ` [PATCH 2/3] perf tools: Ensure reserved member of PERF_SAMPLE_CPU is zero in perf_event__synthesize_sample() Adrian Hunter
2018-01-24 11:19   ` tip-bot for Adrian Hunter [this message]
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=tip-59a87fdad1467d228acc5cb1303b0b568a9e86a8@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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