aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-kmem.c
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2020-07-08 11:39:19 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-07-10 09:37:55 -0300
commitbe8299e4a2e244d5645392f54b2bf1bbd576813a (patch)
treed4e55c4e3e8cd7b1ee49c2eb8fb045ba29d7abf6 /tools/perf/builtin-kmem.c
parentperf parse-events: Report BPF errors (diff)
downloadlinux-dev-be8299e4a2e244d5645392f54b2bf1bbd576813a.tar.xz
linux-dev-be8299e4a2e244d5645392f54b2bf1bbd576813a.zip
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>
Diffstat (limited to 'tools/perf/builtin-kmem.c')
-rw-r--r--tools/perf/builtin-kmem.c3
1 files changed, 2 insertions, 1 deletions
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);