[PATCH] perf tools: Allow multiple cpus record for -p option

From: Jiri Olsa
Date: Fri Nov 01 2013 - 11:53:14 EST


Currently we don't create default CPU map for task related
target, like:

$ perf record -p <pid>

This makes record command to disable inherited events.
which is not desired behaviour (we have special option
for that (-i) anyway).

Fixing this by creating default CPU map for task related
processes.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/evlist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 0582f67..52bb127 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -804,7 +804,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist,
return -1;

if (perf_target__has_task(target))
- evlist->cpus = cpu_map__dummy_new();
+ evlist->cpus = cpu_map__new(target->cpu_list);
else if (!perf_target__has_cpu(target) && !target->uses_mmap)
evlist->cpus = cpu_map__dummy_new();
else
--
1.7.11.7

--
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/