perf tools: Honour the cpu list parameter when also monitoring a thread list
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 25 Apr 2011 19:25:20 +0000 (16:25 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Sun, 15 May 2011 12:32:52 +0000 (09:32 -0300)
The perf_evlist__create_maps was discarding the --cpu parameter when a
--pid or --tid was specified, fix that.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Link: http://lkml.kernel.org/r/20110426204401.GB1746@ghostprotocols.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evlist.c

index 45da8d186b492d4f82512862aef867acd4649f09..1884a7c7eb8f1d3666f47bd38a49202fffdc74d8 100644 (file)
@@ -348,7 +348,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, pid_t target_pid,
        if (evlist->threads == NULL)
                return -1;
 
-       if (target_tid != -1)
+       if (cpu_list == NULL && target_tid != -1)
                evlist->cpus = cpu_map__dummy_new();
        else
                evlist->cpus = cpu_map__new(cpu_list);