From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@linux.intel.com>, Ian Rogers <irogers@google.com>,
Song Liu <songliubraving@fb.com>, Hao Luo <haoluo@google.com>,
Milian Wolff <milian.wolff@kdab.com>,
bpf@vger.kernel.org, linux-perf-users@vger.kernel.org,
Blake Jones <blakejones@google.com>
Subject: Re: [PATCH 1/4] perf report: Do not extend sample type of bpf-output event
Date: Tue, 10 May 2022 13:49:57 -0300 [thread overview]
Message-ID: <YnqXtRqW1phdtc7a@kernel.org> (raw)
In-Reply-To: <20220506201627.85598-2-namhyung@kernel.org>
Em Fri, May 06, 2022 at 01:16:24PM -0700, Namhyung Kim escreveu:
> Currently evsel__new_idx() sets more sample_type bits when it finds a
> BPF-output event. But it should honor what's recorded in the perf
> data file rather than blindly sets the bits. Otherwise it could lead
> to a parse error when it recorded with a modified sample_type.
Can you please try to provide a Fixes: tag for this? This way reviewing
gets simpler by looking at who introduced this, if there was some reason
or if it was a plain oversight.
It also helps to get this fix propabated to the stable trees.
- Arnaldo
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/util/evsel.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
> index d38722560e80..63a8b832b822 100644
> --- a/tools/perf/util/evsel.c
> +++ b/tools/perf/util/evsel.c
> @@ -269,8 +269,8 @@ struct evsel *evsel__new_idx(struct perf_event_attr *attr, int idx)
> return NULL;
> evsel__init(evsel, attr, idx);
>
> - if (evsel__is_bpf_output(evsel)) {
> - evsel->core.attr.sample_type |= (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME |
> + if (evsel__is_bpf_output(evsel) && !attr->sample_type) {
> + evsel->core.attr.sample_type = (PERF_SAMPLE_RAW | PERF_SAMPLE_TIME |
> PERF_SAMPLE_CPU | PERF_SAMPLE_PERIOD),
> evsel->core.attr.sample_period = 1;
> }
> --
> 2.36.0.512.ge40c2bad7a-goog
--
- Arnaldo
next prev parent reply other threads:[~2022-05-10 16:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-06 20:16 [RFC 0/4] perf record: Implement off-cpu profiling with BPF (v2) Namhyung Kim
2022-05-06 20:16 ` [PATCH 1/4] perf report: Do not extend sample type of bpf-output event Namhyung Kim
2022-05-10 16:49 ` Arnaldo Carvalho de Melo [this message]
2022-05-12 6:00 ` Namhyung Kim
2022-05-06 20:16 ` [PATCH 2/4] perf record: Enable off-cpu analysis with BPF Namhyung Kim
2022-05-10 17:02 ` Arnaldo Carvalho de Melo
2022-05-12 6:13 ` Namhyung Kim
2022-05-06 20:16 ` [PATCH 3/4] perf record: Implement basic filtering for off-cpu Namhyung Kim
2022-05-06 20:16 ` [PATCH 4/4] perf record: Handle argument change in sched_switch Namhyung Kim
-- strict thread matches above, loose matches on Subject: below --
2022-04-22 15:05 [RFC RESEND 0/4] perf record: Implement off-cpu profiling with BPF (v1) Namhyung Kim
2022-04-22 15:05 ` [PATCH 1/4] perf report: Do not extend sample type of bpf-output event Namhyung Kim
2022-04-22 5:33 [RFC 0/4] perf record: Implement off-cpu profiling with BPF (v1) Namhyung Kim
2022-04-22 5:33 ` [PATCH 1/4] perf report: Do not extend sample type of bpf-output event Namhyung Kim
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=YnqXtRqW1phdtc7a@kernel.org \
--to=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=blakejones@google.com \
--cc=bpf@vger.kernel.org \
--cc=haoluo@google.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=milian.wolff@kdab.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.com \
/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;
as well as URLs for NNTP newsgroup(s).