lkml.org 
[lkml]   [2020]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/3] perf list: Add 'pfm' to list libpfm4 events
HI Ian,

On Wed, Sep 23, 2020 at 5:50 AM Ian Rogers <irogers@google.com> wrote:
>
> On Tue, Sep 8, 2020 at 10:59 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > Print libpfm4 events with 'perf list pfm' command like others.
> > When libpfm4 support is not enabled, it'd print nothing.
> > Also it support glob pattern matching for event name.
> >
> > $ perf list pfm
> >
> > List of pre-defined events (to be used in --pfm-events):
> >
> > ix86arch:
> > UNHALTED_CORE_CYCLES
> > [count core clock cycles whenever the clock signal ...
> > INSTRUCTION_RETIRED
> > [count the number of instructions at retirement. ...
> > ...
> >
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> >
> > diff --git a/tools/perf/builtin-list.c b/tools/perf/builtin-list.c
> > index 10ab5e40a34f..167868053fe0 100644
> > --- a/tools/perf/builtin-list.c
> > +++ b/tools/perf/builtin-list.c
> > @@ -14,6 +14,7 @@
> > #include "util/pmu.h"
> > #include "util/debug.h"
> > #include "util/metricgroup.h"
> > +#include "util/pfm.h"
> > #include <subcmd/pager.h>
> > #include <subcmd/parse-options.h>
> > #include <stdio.h>
> > @@ -42,7 +43,7 @@ int cmd_list(int argc, const char **argv)
> > OPT_END()
> > };
> > const char * const list_usage[] = {
> > - "perf list [<options>] [hw|sw|cache|tracepoint|pmu|sdt|metric|metricgroup|event_glob]",
> > + "perf list [<options>] [hw|sw|cache|tracepoint|pmu|sdt|metric|metricgroup|pfm|event_glob]",
>
> Should this be "#ifdef HAVE_LIBPFM" to avoid advertising pfm events
> when support isn't compiled in?

I thought about that too, but it's a keyword and current code
already handles it to print nothing, so I think it's ok to have.

Thanks
Namhyung

\
 
 \ /
  Last update: 2020-09-23 00:47    [W:0.061 / U:1.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site