[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cgDTy96eeCAARufSKZJFMvAAo6QSLAoEQv_zUFD-Rf+Lw@mail.gmail.com>
Date: Thu, 22 Sep 2022 09:32:06 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Song Liu <songliubraving@...com>,
Ravi Bangoria <ravi.bangoria@....com>,
Stephane Eranian <eranian@...gle.com>,
Kan Liang <kan.liang@...ux.intel.com>
Subject: Re: [PATCH 1/2] perf: Use sample_flags for addr
Hi Peter,
On Thu, Sep 22, 2022 at 7:48 AM Peter Zijlstra <peterz@...radead.org> wrote:
>
> On Wed, Sep 21, 2022 at 03:00:31PM -0700, Namhyung Kim wrote:
> > Use the new sample_flags to indicate whether the addr field is filled by
> > the PMU driver. As most PMU drivers pass 0, it can set the flag only if
> > it has a non-zero value. And use 0 in perf_sample_output() if it's not
> > filled already.
>
> So no objection to the general idea; just a question
>
> > diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> > index 368bdc4f563f..f4a13579b0e8 100644
> > --- a/include/linux/perf_event.h
> > +++ b/include/linux/perf_event.h
> > @@ -1028,7 +1028,6 @@ struct perf_sample_data {
> > * minimize the cachelines touched.
> > */
> > u64 sample_flags;
> > - u64 addr;
> > struct perf_raw_record *raw;
> > u64 period;
> >
> > @@ -1040,6 +1039,7 @@ struct perf_sample_data {
> > union perf_sample_weight weight;
> > union perf_mem_data_src data_src;
> > u64 txn;
> > + u64 addr;
> >
> > u64 type;
> > u64 ip;
>
> Is there a reason you placed the variable where you did?
No I just followed the previous change.
>
> I'm thinking we should look at what perf-tool thinks is the common set
> of SAMPLE flags and make sure those fields are grouped in as little
> cachelines as possible.
>
> Things like @ip and @type, which are basically *always* set, should
> definitely be on top, no?
Yes, you're right. With this change we can move the optional fields
and group the common fields on top - like ip, period, pid and so on.
Will send a patch to do the move on top of this, ok?
Thanks,
Namhyung
Powered by blists - more mailing lists