[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAP-5=fUpn0fecOyXH14Wjo7SCqV5wnkMcZwDvB8wJ5z5Jc2FHw@mail.gmail.com>
Date: Wed, 27 Nov 2019 10:33:30 -0800
From: Ian Rogers <irogers@...gle.com>
To: Jiri Olsa <jolsa@...hat.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Namhyung Kim <namhyung@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH] perf c2c: fix '-e list'
On Wed, Nov 27, 2019 at 12:18 AM Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Tue, Nov 26, 2019 at 11:34:42PM -0800, Ian Rogers wrote:
> > When the event is passed as list, the default events should be listed as
> > per 'perf mem record -e list'. Previous behavior is:
> >
> > $ perf c2c record -e list
> > failed: event 'list' not found, use '-e list' to get list of available events
> >
> > Usage: perf c2c record [<options>] [<command>]
> > or: perf c2c record [<options>] -- <command> [<options>]
> >
> > -e, --event <event> event selector. Use 'perf mem record -e list' to list available events
>
> man c2c page do say you should use 'perf mem' not 'perf c2c'
> could you please change the man page as well?
Done.
> >
> > New behavior:
> >
> > $ perf c2c record -e list
> > ldlat-loads : available
> > ldlat-stores : available
> >
> > Signed-off-by: Ian Rogers <irogers@...gle.com>
> > ---
> > tools/perf/builtin-c2c.c | 20 ++++++++++++++++++--
> > 1 file changed, 18 insertions(+), 2 deletions(-)
> >
> > diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> > index e69f44941aad..dd69cd218e4c 100644
> > --- a/tools/perf/builtin-c2c.c
> > +++ b/tools/perf/builtin-c2c.c
> > @@ -2872,10 +2872,26 @@ static int perf_c2c__report(int argc, const char **argv)
> > static int parse_record_events(const struct option *opt,
> > const char *str, int unset __maybe_unused)
> > {
> > + int j;
> > bool *event_set = (bool *) opt->value;
> >
> > - *event_set = true;
> > - return perf_mem_events__parse(str);
> > + if (strcmp(str, "list")) {
> > + *event_set = true;
> > + if (!perf_mem_events__parse(str))
> > + return 0;
> > +
> > + exit(-1);
> > + }
> > + for (j = 0; j < PERF_MEM_EVENTS__MAX; j++) {
> > + struct perf_mem_event *e = &perf_mem_events[j];
> > +
> > + fprintf(stderr, "%-13s%-*s%s\n",
> > + e->tag,
> > + verbose > 0 ? 25 : 0,
> > + verbose > 0 ? perf_mem_events__name(j) : "",
> > + e->supported ? ": available" : "");
> > + }
>
> there's same loop in builtin-mem.c, could you please put it
> to function in mem-events.c?
Done.
Thanks for the review!
Ian
> thanks,
> jirka
>
Powered by blists - more mailing lists