perf sched: Make common options cascading
authorNamhyung Kim <namhyung@kernel.org>
Mon, 24 Oct 2016 03:00:03 +0000 (12:00 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 25 Oct 2016 13:24:48 +0000 (10:24 -0300)
commit77f02f44460ab1480af2ae6145a1a85b9fe0b8ac
tree89a0dfd42c1afd1475d5ea013e5e8cd99d2e4bc6
parent369a2478973a416a2c42a37a8cf7031872a6d926
perf sched: Make common options cascading

The -i and -v options can be used in subcommands so enable cascading the
sched_options.  This fixes the following inconvenience in 'perf sched':

  $ perf sched -i perf.data.sched  map
  ... (it works well) ...

  $ perf sched map  -i perf.data.sched
    Error: unknown switch `i'

   Usage: perf sched map [<options>]

          --color-cpus <cpus>
                            highlight given CPUs in map
          --color-pids <pids>
                            highlight given pids in map
          --compact         map output in compact mode
          --cpus <cpus>     display given CPUs in map

With this patch, the second command line works with the perf.data.sched
data file.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20161024030003.28534-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-sched.c