[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1329118064-9412-8-git-send-email-namhyung.kim@lge.com>
Date: Mon, 13 Feb 2012 16:27:39 +0900
From: Namhyung Kim <namhyung.kim@....com>
To: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Cc: Namhyung Kim <namhyung@...il.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
linux-kernel@...r.kernel.org
Subject: [PATCH 07/11] perf tools: Fix creation of cpu map
Currently, 'perf record -- sleep 1' creates a cpu map for all online
cpus since it turns out calling cpu_map__new(NULL). Fix it. Also it
is guaranteed that cpu_list is NULL if PID/TID is given by calling
check_target_maps(), so we can make the conditional bit simpler.
Signed-off-by: Namhyung Kim <namhyung.kim@....com>
---
tools/perf/util/evlist.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 3d763c95fd62..b444f311897c 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -602,8 +602,9 @@ int perf_evlist__create_maps(struct perf_evlist *evlist,
if (evlist->threads == NULL)
return -1;
- if (maps->uid != UINT_MAX ||
- (maps->cpu_list == NULL && maps->target_tid != -1))
+ if (maps->uid != UINT_MAX || maps->target_tid != -1)
+ evlist->cpus = cpu_map__dummy_new();
+ else if (!maps->system_wide && maps->cpu_list == NULL)
evlist->cpus = cpu_map__dummy_new();
else
evlist->cpus = cpu_map__new(maps->cpu_list);
--
1.7.9
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists