lkml.org 
[lkml]   [2023]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [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

\
 
 \ /
  Last update: 2023-03-26 23:41    [W:0.045 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site