]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf record: Add -a as default target
authorJiri Olsa <jolsa@redhat.com>
Fri, 17 Feb 2017 17:00:18 +0000 (18:00 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 17 Feb 2017 20:32:38 +0000 (17:32 -0300)
Running 'perf record' with no target (-a, -p, -t, etc) will now collect
system wide data.

Commiter notes:

Testing it:

  [root@jouet ~]# perf record
  ^C[ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.351 MB perf.data (366 samples) ]
  #

is equivalent to:

  # perf record -a
  ^C[ perf record: Woken up 1 times to write data ]
  [ perf record: Captured and wrote 1.411 MB perf.data (978 samples) ]
  #

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20170217170018.GA15389@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-record.txt
tools/perf/builtin-record.c

index 27256bc68eda0268fc79d9d9eca06bb349a8212e..b16003ec14a743bcdcc8473798388b0849aa3523 100644 (file)
@@ -157,7 +157,7 @@ OPTIONS
 
 -a::
 --all-cpus::
-        System-wide collection from all CPUs.
+        System-wide collection from all CPUs (default if no target is specified).
 
 -p::
 --pid=::
index 6cd6776052e7a940f78c78d43e623709256a0711..b87bbef733944d5a5cda318ce1d97c57523247f2 100644 (file)
@@ -1677,8 +1677,10 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
 
        argc = parse_options(argc, argv, record_options, record_usage,
                            PARSE_OPT_STOP_AT_NON_OPTION);
+
+       /* Make system wide (-a) the default target. */
        if (!argc && target__none(&rec->opts.target))
-               usage_with_options(record_usage, record_options);
+               rec->opts.target.system_wide = true;
 
        if (nr_cgroups && !rec->opts.target.system_wide) {
                usage_with_options_msg(record_usage, record_options,