Messages in this thread | | | From | Namhyung Kim <> | Date | Fri, 13 Jan 2023 11:31:10 -0800 | Subject | Re: [PATCH 5/8] perf/core: Set data->sample_flags in perf_prepare_sample() |
| |
On Fri, Jan 13, 2023 at 3:20 AM Peter Zijlstra <peterz@infradead.org> wrote: > > On Thu, Jan 12, 2023 at 01:40:12PM -0800, Namhyung Kim wrote: > > > --- a/kernel/events/core.c > > +++ b/kernel/events/core.c > > @@ -7053,6 +7053,14 @@ static void perf_aux_sample_output(struct perf_event *event, > > ring_buffer_put(rb); > > } > > > > +/* > > + * A set of common sample data types saved even for non-sample records > > + * when event->attr.sample_id_all is set. > > + */ > > +#define PERF_SAMPLE_ID_ALL (PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \ > > + PERF_SAMPLE_CPU | PERF_SAMPLE_ID | \ > > + PERF_SAMPLE_IDENTIFIER | PERF_SAMPLE_STREAM_ID) > > + > > > > __perf_event_header__init_id(header, data, event, filtered_sample_type); > > + data->sample_flags |= sample_type & PERF_SAMPLE_ID_ALL; > > Why not update __perf_event_header__init_id() ?
My concern was the non-sample records which don't check the sample flags at all. So I'd like to skip the write for them.
But that's not a big deal. I can move it if you want.
Thanks, Namhyung
| |