perf stat: Don't require a workload when using system wide or CPU options
authorDavid Ahern <[email protected]>
Mon, 30 Sep 2013 13:37:37 +0000 (07:37 -0600)
committerArnaldo Carvalho de Melo <[email protected]>
Fri, 11 Oct 2013 15:17:44 +0000 (12:17 -0300)
The "perf stat" command can do system wide counters or one or more cpus.
For these options do not require a workload to be specified.

v2: use perf_target__none per Namhyung's comment.

Signed-off-by: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-stat.c

index c8a2662eb57a074adfafe89919a653fe0b33e9c3..2178e6636f71d7b3c9f12f05d1fdd93de81480d8 100644 (file)
@@ -1659,8 +1659,9 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused)
        } else if (big_num_opt == 0) /* User passed --no-big-num */
                big_num = false;
 
-       if (!argc && !perf_target__has_task(&target))
+       if (!argc && perf_target__none(&target))
                usage_with_options(stat_usage, options);
+
        if (run_count < 0) {
                usage_with_options(stat_usage, options);
        } else if (run_count == 0) {