mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-10 11:30:08 +01:00
perf evlist: 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 perf_target__validate(), so we can make the conditional bit simpler. This also fixes perf test 7 (Validate) failure on my 6 core machine: $ cat /sys/devices/system/cpu/online 0-11 $ ./perf test -v 7 7: Validate PERF_RECORD_* events & perf_sample fields: --- start --- perf_evlist__mmap: Operation not permitted ---- end ---- Validate PERF_RECORD_* events & perf_sample fields: FAILED! Signed-off-by: Namhyung Kim <[email protected]> Reviewed-by: David Ahern <[email protected]> Cc: David Ahern <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
1 parent
10b47d5415
commit
55261f4670
1 file changed
+3
-2
@@ -609,8 +609,9 @@ int perf_evlist__create_maps(struct perf_evlist *evlist,
|
||||
if (evlist->threads == NULL)
|
||||
return -1;
|
||||
|
||||
if (target->uid != UINT_MAX ||
|
||||
(target->cpu_list == NULL && target->tid))
|
||||
if (target->uid != UINT_MAX || target->tid)
|
||||
evlist->cpus = cpu_map__dummy_new();
|
||||
else if (!target->system_wide && target->cpu_list == NULL)
|
||||
evlist->cpus = cpu_map__dummy_new();
|
||||
else
|
||||
evlist->cpus = cpu_map__new(target->cpu_list);
|
||||
|
||||
Reference in new issue
Block a user