public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org,
	Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf kmem: pass additional arguments to record
Date: Fri, 10 Jul 2020 09:39:22 -0300	[thread overview]
Message-ID: <20200710123922.GE22500@kernel.org> (raw)
In-Reply-To: <20200708183919.4141023-1-irogers@google.com>

Em Wed, Jul 08, 2020 at 11:39:19AM -0700, Ian Rogers escreveu:
> perf kmem has an input file option but current an output file option
> fails:
> ```
> $ sudo perf kmem record -o /tmp/p.data sleep 1  
>  Error: unknown switch `o'
> 
> Usage: perf kmem [<options>] {record|stat}
> 
>    -f, --force           don't complain, do it
>    -i, --input <file>    input file name
>    -l, --line <num>      show n lines
>    -s, --sort <key[,key2...]>
>                          sort by keys: ptr, callsite, bytes, hit, pingpong, frag, page, order, mig>
>    -v, --verbose         be more verbose (show symbol address, etc)
>        --alloc           show per-allocation statistics
>        --caller          show per-callsite statistics
>        --live            Show live page stat
>        --page            Analyze page allocator
>        --raw-ip          show raw ip instead of symbol
>        --slab            Analyze slab allocator
>        --time <str>      Time span of interest (start,stop)
> ```
> perf sched is similar in implementation and avoids the problem by
> passing additional arguments to perf record. This change makes perf kmem
> parse command line options consistently with perf sched, although
> neither actually list that -o is a supported option.

Thanks, tested and applied.

- Arnaldo
 
> Signed-off-by: Ian Rogers <irogers@google.com>
> ---
>  tools/perf/builtin-kmem.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/builtin-kmem.c b/tools/perf/builtin-kmem.c
> index 38a5ab683ebc..a50dae2c4ae9 100644
> --- a/tools/perf/builtin-kmem.c
> +++ b/tools/perf/builtin-kmem.c
> @@ -1933,7 +1933,8 @@ int cmd_kmem(int argc, const char **argv)
>  		return ret;
>  
>  	argc = parse_options_subcommand(argc, argv, kmem_options,
> -					kmem_subcommands, kmem_usage, 0);
> +					kmem_subcommands, kmem_usage,
> +					PARSE_OPT_STOP_AT_NON_OPTION);
>  
>  	if (!argc)
>  		usage_with_options(kmem_usage, kmem_options);
> -- 
> 2.27.0.383.g050319c2ae-goog
> 

-- 

- Arnaldo

      reply	other threads:[~2020-07-10 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 18:39 [PATCH] perf kmem: pass additional arguments to record Ian Rogers
2020-07-10 12:39 ` Arnaldo Carvalho de Melo [this message]

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=20200710123922.GE22500@kernel.org \
    --to=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox