Re: [PATCH 1/2] perf top: Decay all events in the evlist
From: Namhyung Kim
Date: Thu Aug 29 2019 - 23:58:23 EST
Hi Arnaldo,
On Wed, Aug 28, 2019 at 9:49 PM Arnaldo Carvalho de Melo
<acme@xxxxxxxxxx> wrote:
>
> Em Wed, Aug 28, 2019 at 08:15:54AM +0900, Namhyung Kim escreveu:
> > Currently perf top only decays entries in a selected evsel. I don't
> > know whether it's intended (maybe due to performance reason?) but
> > anyway it might show incorrect output when event group is used since
> > users will see leader event is decayed but others are not.
> >
> > This patch moves the decay code into evlist__resort_hists() so that
> > stdio and tui code shared the logic.
> >
> > Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
> > ---
> > tools/perf/builtin-top.c | 38 +++++++++++++-------------------------
> > 1 file changed, 13 insertions(+), 25 deletions(-)
> >
> > diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
> > index 5970723cd55a..9d3059d2029d 100644
> > --- a/tools/perf/builtin-top.c
> > +++ b/tools/perf/builtin-top.c
> > @@ -264,13 +264,23 @@ static void perf_top__show_details(struct perf_top *top)
> > pthread_mutex_unlock(¬es->lock);
> > }
> >
> > -static void evlist__resort_hists(struct evlist *evlist)
> > +static void evlist__resort_hists(struct perf_top *t)
>
> Since this now operates on the perf_top struct, I'll rename it to
> perf_top__resort_hists(), ok? No need to send an updated patch.
Right. Thanks for doing this!
Namhyung