[tip:perf/core] perf top: Default to system wide using perf_target methods

From: tip-bot for Arnaldo Carvalho de Melo
Date: Fri May 11 2012 - 02:45:05 EST


Commit-ID: 80eebd94d2090cf9e13ecdc305a0cf7996fa0070
Gitweb: http://git.kernel.org/tip/80eebd94d2090cf9e13ecdc305a0cf7996fa0070
Author: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
AuthorDate: Tue, 8 May 2012 10:47:09 -0300
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Tue, 8 May 2012 10:47:09 -0300

perf top: Default to system wide using perf_target methods

Additionally we were not checking if a cpu list had been provided by the
user. Fix that.

Reported-by: David Ahern <dsahern@xxxxxxxxx>
Reported-by: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Mike Galbraith <efault@xxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Link: http://lkml.kernel.org/n/tip-ao3zrouylwmt7h9ikj0krubi@xxxxxxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/builtin-top.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index e4ca827..c53cdab 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -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)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/