perf kmem: Pass additional arguments to 'perf record'
authorIan Rogers <irogers@google.com>
Wed, 8 Jul 2020 18:39:19 +0000 (11:39 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 10 Jul 2020 12:37:55 +0000 (09:37 -0300)
commitbe8299e4a2e244d5645392f54b2bf1bbd576813a
treed4e55c4e3e8cd7b1ee49c2eb8fb045ba29d7abf6
parent5f634c8e401df25c479c8d07ed575804059c3826
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: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-kmem.c