linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/1] perf report TUI: Remove needless 'dummy' event from menu
       [not found] <20200703123431.GG1320@kernel.org>
@ 2020-07-03 13:44 ` Namhyung Kim
  2020-07-06 11:54   ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2020-07-03 13:44 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Jiri Olsa, Adrian Hunter, Linux Kernel Mailing List

Hi Arnaldo,

On Fri, Jul 3, 2020 at 9:34 PM Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
>
> Please Ack,
>
> - Arnaldo
>
> ----
>
> Fixing the common case of:
>
>   perf record
>   perf report
>
> And getting just the cycles events.
>
> We now have a 'dummy' event to get perf metadata events that take place
> while we synthesize metadata records for pre-existing processes by
> traversing procfs, so we always have this extra 'dummy' evsel, but we
> don't have to offer it as there will be no samples on it, remove this
> distraction.
>
> Cc: Adrian Hunter <adrian.hunter@intel.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Jiri Olsa <jolsa@kernel.org>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
>  tools/perf/ui/browsers/hists.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> index 4cd556c1276f..be9c4c0549bc 100644
> --- a/tools/perf/ui/browsers/hists.c
> +++ b/tools/perf/ui/browsers/hists.c
> @@ -3603,6 +3603,23 @@ static int __perf_evlist__tui_browse_hists(struct evlist *evlist,
>                                     hbt, warn_lost_event);
>  }
>
> +static bool perf_evlist__single_entry(struct evlist *evlist)
> +{
> +       int nr_entries = evlist->core.nr_entries;
> +
> +       if (nr_entries == 1)
> +              return true;
> +
> +       if (nr_entries == 2) {
> +               struct evsel *last = evlist__last(evlist);
> +
> +               if (evsel__is_dummy_event(last))
> +                       return true;
> +       }
> +
> +       return false;
> +}
> +
>  int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
>                                   struct hist_browser_timer *hbt,
>                                   float min_pcnt,
> @@ -3613,7 +3630,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
>         int nr_entries = evlist->core.nr_entries;
>
>  single_entry:
> -       if (nr_entries == 1) {
> +       if (perf_evlist__single_entry(evlist)) {

But I think it cannot cover the event group case below..

Thanks
Namhyung


>                 struct evsel *first = evlist__first(evlist);
>
>                 return perf_evsel__hists_browse(first, nr_entries, help,
> --
> 2.21.3
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] perf report TUI: Remove needless 'dummy' event from menu
  2020-07-03 13:44 ` [PATCH 1/1] perf report TUI: Remove needless 'dummy' event from menu Namhyung Kim
@ 2020-07-06 11:54   ` Arnaldo Carvalho de Melo
  2020-07-06 15:12     ` Namhyung Kim
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2020-07-06 11:54 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Ian Rogers, Jiri Olsa, Adrian Hunter, Linux Kernel Mailing List

Em Fri, Jul 03, 2020 at 10:44:28PM +0900, Namhyung Kim escreveu:
> Hi Arnaldo,
> 
> On Fri, Jul 3, 2020 at 9:34 PM Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> >
> > Please Ack,
> >
> > - Arnaldo
> >
> > ----
> >
> > Fixing the common case of:
> >
> >   perf record
> >   perf report
> >
> > And getting just the cycles events.
> >
> > We now have a 'dummy' event to get perf metadata events that take place
> > while we synthesize metadata records for pre-existing processes by
> > traversing procfs, so we always have this extra 'dummy' evsel, but we
> > don't have to offer it as there will be no samples on it, remove this
> > distraction.
> >
> > Cc: Adrian Hunter <adrian.hunter@intel.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Jiri Olsa <jolsa@kernel.org>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > ---
> >  tools/perf/ui/browsers/hists.c | 19 ++++++++++++++++++-
> >  1 file changed, 18 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
> > index 4cd556c1276f..be9c4c0549bc 100644
> > --- a/tools/perf/ui/browsers/hists.c
> > +++ b/tools/perf/ui/browsers/hists.c
> > @@ -3603,6 +3603,23 @@ static int __perf_evlist__tui_browse_hists(struct evlist *evlist,
> >                                     hbt, warn_lost_event);
> >  }
> >
> > +static bool perf_evlist__single_entry(struct evlist *evlist)
> > +{
> > +       int nr_entries = evlist->core.nr_entries;
> > +
> > +       if (nr_entries == 1)
> > +              return true;
> > +
> > +       if (nr_entries == 2) {
> > +               struct evsel *last = evlist__last(evlist);
> > +
> > +               if (evsel__is_dummy_event(last))
> > +                       return true;
> > +       }
> > +
> > +       return false;
> > +}
> > +
> >  int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
> >                                   struct hist_browser_timer *hbt,
> >                                   float min_pcnt,
> > @@ -3613,7 +3630,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
> >         int nr_entries = evlist->core.nr_entries;
> >
> >  single_entry:
> > -       if (nr_entries == 1) {
> > +       if (perf_evlist__single_entry(evlist)) {
> 
> But I think it cannot cover the event group case below..

Right, we can fix that later, I think, my worry at this point was that
the simplest case, which is:

   # perf record
   ^C
   # perf report

Would get that annoyance :-)

- Arnaldo
 
> Thanks
> Namhyung
> 
> 
> >                 struct evsel *first = evlist__first(evlist);
> >
> >                 return perf_evsel__hists_browse(first, nr_entries, help,
> > --
> > 2.21.3
> >


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] perf report TUI: Remove needless 'dummy' event from menu
  2020-07-06 11:54   ` Arnaldo Carvalho de Melo
@ 2020-07-06 15:12     ` Namhyung Kim
  0 siblings, 0 replies; 3+ messages in thread
From: Namhyung Kim @ 2020-07-06 15:12 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ian Rogers, Jiri Olsa, Adrian Hunter, Linux Kernel Mailing List

On Mon, Jul 6, 2020 at 8:55 PM Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
>
> Em Fri, Jul 03, 2020 at 10:44:28PM +0900, Namhyung Kim escreveu:
> > > @@ -3613,7 +3630,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
> > >         int nr_entries = evlist->core.nr_entries;
> > >
> > >  single_entry:
> > > -       if (nr_entries == 1) {
> > > +       if (perf_evlist__single_entry(evlist)) {
> >
> > But I think it cannot cover the event group case below..
>
> Right, we can fix that later, I think, my worry at this point was that
> the simplest case, which is:
>
>    # perf record
>    ^C
>    # perf report
>
> Would get that annoyance :-)

Right, then I suggest moving the 'single_entry' label to inside of the
if statement.
With that applied,

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks
Namhyung

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-06 15:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200703123431.GG1320@kernel.org>
2020-07-03 13:44 ` [PATCH 1/1] perf report TUI: Remove needless 'dummy' event from menu Namhyung Kim
2020-07-06 11:54   ` Arnaldo Carvalho de Melo
2020-07-06 15:12     ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).