Commit be8299e4 authored by Ian Rogers's avatar Ian Rogers Committed by Arnaldo Carvalho de Melo

perf kmem: Pass additional arguments to 'perf record'

'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.
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20200708183919.4141023-1-irogers@google.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 5f634c8e
...@@ -1933,7 +1933,8 @@ int cmd_kmem(int argc, const char **argv) ...@@ -1933,7 +1933,8 @@ int cmd_kmem(int argc, const char **argv)
return ret; return ret;
argc = parse_options_subcommand(argc, argv, kmem_options, 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) if (!argc)
usage_with_options(kmem_usage, kmem_options); usage_with_options(kmem_usage, kmem_options);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment