Skip to content

Commit cb71f7d

Browse files
olsajiriacmel
authored andcommitted
libperf: Setup initial evlist::all_cpus value
Jann Horn reported crash in perf ftrace because evlist::all_cpus isn't initialized if there's evlist without events, which is the case for perf ftrace. Adding initial initialization of evlist::all_cpus from given cpus, regardless of events in the evlist. Fixes: 7736627 ("perf stat: Use affinity for closing file descriptors") Reported-by: Jann Horn <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Acked-by: Andi Kleen <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Michael Petlan <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent c3314a7 commit cb71f7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/lib/perf/evlist.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist,
164164
evlist->threads = perf_thread_map__get(threads);
165165
}
166166

167+
if (!evlist->all_cpus && cpus)
168+
evlist->all_cpus = perf_cpu_map__get(cpus);
169+
167170
perf_evlist__propagate_maps(evlist);
168171
}
169172

0 commit comments

Comments
 (0)