All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Kan Liang <kan.liang@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	linux-kernel@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH v3] perf c2c: fix '-e list'
Date: Mon, 11 May 2020 21:36:04 +0200	[thread overview]
Message-ID: <20200511193604.GF2986380@krava> (raw)
In-Reply-To: <20200507220604.3391-1-irogers@google.com>

On Thu, May 07, 2020 at 03:06:04PM -0700, 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
> 
> New behavior:
> 
> $ perf c2c record -e list
> ldlat-loads  : available
> ldlat-stores : available
> 
> v3: is a rebase.
> v2: addresses review comments by Jiri Olsa.
> https://lore.kernel.org/lkml/20191127081844.GH32367@krava/
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/Documentation/perf-c2c.txt |  2 +-
>  tools/perf/builtin-c2c.c              |  9 ++++++++-
>  tools/perf/builtin-mem.c              | 24 +++++++-----------------
>  tools/perf/util/mem-events.c          | 15 +++++++++++++++
>  tools/perf/util/mem-events.h          |  2 ++
>  5 files changed, 33 insertions(+), 19 deletions(-)
> 
> diff --git a/tools/perf/Documentation/perf-c2c.txt b/tools/perf/Documentation/perf-c2c.txt
> index 2133eb320cb0..98efdab5fbd4 100644
> --- a/tools/perf/Documentation/perf-c2c.txt
> +++ b/tools/perf/Documentation/perf-c2c.txt
> @@ -40,7 +40,7 @@ RECORD OPTIONS
>  --------------
>  -e::
>  --event=::
> -	Select the PMU event. Use 'perf mem record -e list'
> +	Select the PMU event. Use 'perf c2c record -e list'
>  	to list available events.
>  
>  -v::
> diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c
> index 1baf4cae086f..d617d5682c68 100644
> --- a/tools/perf/builtin-c2c.c
> +++ b/tools/perf/builtin-c2c.c
> @@ -2887,8 +2887,15 @@ static int parse_record_events(const struct option *opt,
>  {
>  	bool *event_set = (bool *) opt->value;
>  
> +	if (!strcmp(str, "list")) {
> +		perf_mem_events__list();
> +		exit(0);
> +	}
> +	if (perf_mem_events__parse(str))
> +		exit(-1);

won't this exit(-1) callsbreak the parsing stuff?
like displaying the option values on error or such?

other than that it looks ok to me

jirka


  parent reply	other threads:[~2020-05-11 19:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 22:06 [PATCH v3] perf c2c: fix '-e list' Ian Rogers
2020-05-11 15:55 ` Arnaldo Carvalho de Melo
2020-05-11 19:36 ` Jiri Olsa [this message]
2020-05-11 20:29   ` Ian Rogers
2020-05-11 21:08     ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200511193604.GF2986380@krava \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.