Commit 3c17e7f0 authored by Li Huafei's avatar Li Huafei Committed by Zheng Zengkai
Browse files

perf kmem: Do not pass additional arguments to 'perf record'



hulk inclusion
category: bugfix
bugzilla: 51797
CVE: NA

--------------------------------

The commit be8299e4 passes additional arguments directly to the
'perf record' to support the '-o' option. If used in the current
format of the'perf kmem --help' command, there is no problem. But
we're used to using this: 'perf kmem record --slab --page', where the
subcommand is placed before the option. After the commit be8299e4,
there is a problem with this use:

  # perf kmem record --slab --page
   Error: unknown option `slab'

  Usage: perf record [<options>] [<command>]
     or: perf record [<options>] -- <command> [<options>]

     -a, --all-cpus        system-wide collection from all CPUs
     -b, --branch-any      sample any taken branches
     -B, --no-buildid      do not collect buildids in perf.data
     -c, --count <n>       event period to sample
     -C, --cpu <cpu>       list of cpus to monitor
     -d, --data            Record the sample addresses
     ...

This is because we pass all the options directly to 'perf record', but
these options are 'perf kmem' options. In order to be able to use the
format 'perf kmem {record|stat} [option]', we revert the commit be8299e4.
In order to still support the '-o' option, we first process the '-o' option
in 'perf kmem' and then add it to the list of options in'perf record'.

Fixes: be8299e4("perf kmem: Pass additional arguments to 'perf record'")
Signed-off-by: default avatarLi Huafei <lihuafei1@huawei.com>
Reviewed-by: default avatarYang Jihong <yangjihong1@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent fbdb75a8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment