Re: [PATCH v2 1/2] perf stat: Introduce struct runtime_stat_data

From: Jiri Olsa
Date: Thu Jan 14 2021 - 08:24:18 EST


On Thu, Jan 14, 2021 at 12:25:39PM +0900, Namhyung Kim wrote:
> Hi Jiri,
>
> On Wed, Jan 13, 2021 at 8:19 PM Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> >
> > On Tue, Jan 12, 2021 at 03:14:30PM +0900, Namhyung Kim wrote:
> > > To pass more info to the saved_value in the runtime_stat, add a new
> > > struct runtime_stat_data. Currently it only has 'ctx' field but later
> > > patch will add more.
> > >
> > > Suggested-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> > > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > > ---
> > > tools/perf/util/stat-shadow.c | 346 +++++++++++++++++-----------------
> > > 1 file changed, 173 insertions(+), 173 deletions(-)
> > >
> > > diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
> > > index 901265127e36..a1565b6e38f2 100644
> > > --- a/tools/perf/util/stat-shadow.c
> > > +++ b/tools/perf/util/stat-shadow.c
> > > @@ -114,6 +114,10 @@ static struct saved_value *saved_value_lookup(struct evsel *evsel,
> > >
> > > rblist = &st->value_list;
> > >
> > > + /* don't use context info for clock events */
> > > + if (type == STAT_NSECS)
> > > + dm.ctx = 0;
> > > +
> >
> > I think this should go to separate patch and be explained,
> > the change is advertised as adding struct for arguments
>
> Actually it was already there and I found it during this work.
> Basically it passes ctx for lookup but it uses 0 for time.
> Please see below..

ah nice, did not see that.. could be mentioned in the changelog ;-)

thanks,
jirka