perf top: Default to system wide using perf_target methods
authorArnaldo Carvalho de Melo <[email protected]>
Tue, 8 May 2012 13:47:09 +0000 (10:47 -0300)
committerArnaldo Carvalho de Melo <[email protected]>
Tue, 8 May 2012 13:47:09 +0000 (10:47 -0300)
Additionally we were not checking if a cpu list had been provided by the
user. Fix that.

Reported-by: David Ahern <[email protected]>
Reported-by: Namhyung Kim <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-top.c

index e4ca827f687916064eb1559cd526043ea16b1537..c53cdab6143331d37934fe2eb1fe89bee146a731 100644 (file)
@@ -1270,8 +1270,7 @@ int cmd_top(int argc, const char **argv, const char *prefix __used)
                goto out_delete_evlist;
        }
 
-       if (top.target.tid == 0 && top.target.pid == 0 &&
-           top.target.uid_str == NULL)
+       if (perf_target__none(&top.target))
                top.target.system_wide = true;
 
        if (perf_evlist__create_maps(top.evlist, &top.target) < 0)