lkml.org 
[lkml]   [2023]   [Jan]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/3] perf/core: Set data->sample_flags in perf_prepare_sample()
On Tue, Jan 10, 2023 at 2:55 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Jan 09, 2023 at 12:21:25PM -0800, Namhyung Kim wrote:
>
> > > However; inspired by your next patch; we can do something like so:
> > >
> > > if (filtered_sample_type & PERF_SAMPLE_CALLCHAIN) {
> > > data->callchain = perf_callchain(event, regs);
> > > data->sample_flags |= PERF_SAMPLE_CALLCHAIN;
> > >
> > > data->size += (1 + data->callchain->nr) * sizeof(u64);
> > > }
> >
> > This is fine as long as all other places (like in PMU drivers) set the
> > callchain update the sample data size accordingly. If not, we can get
> > the callchain but the data size will be wrong.
>
> Good point, maybe add a helper there to ensure that code doesn't
> duplicate/diverge?

Sure, will do.

Thanks,
Namhyung

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