lkml.org 
[lkml]   [2012]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 07/11] perf tools: Fix creation of cpu map
Date
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@lge.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


\
 
 \ /
  Last update: 2012-02-13 08:17    [W:0.229 / U:0.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site