[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240515085755.GC40213@noisy.programming.kicks-ass.net>
Date: Wed, 15 May 2024 10:57:55 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Yabin Cui <yabinc@...gle.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
bpf@...r.kernel.org
Subject: Re: [PATCH v4 1/3] perf/core: Save raw sample data conditionally
based on sample type
On Fri, May 10, 2024 at 12:14:21PM -0700, Yabin Cui wrote:
> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index d2a15c0c6f8a..9fc55193ff99 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -1240,12 +1240,16 @@ static inline void perf_sample_save_callchain(struct perf_sample_data *data,
> }
>
> static inline void perf_sample_save_raw_data(struct perf_sample_data *data,
> + struct perf_event *event,
> struct perf_raw_record *raw)
> {
> struct perf_raw_frag *frag = &raw->frag;
> u32 sum = 0;
> int size;
>
> + if (!(event->attr.sample_type & PERF_SAMPLE_RAW))
> + return;
> +
Should we add something like:
if (WARN_ON_ONCE(data->sample_flags & PERF_SAMPLE_RAW))
return;
? And I suppose the same for all these other patches.
> do {
> sum += frag->size;
> if (perf_raw_frag_last(frag))
Powered by blists - more mailing lists