mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-13 01:08:50 +00:00
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: 7736627b865d ("perf stat: Use affinity for closing file descriptors") Reported-by: Jann Horn <jannh@google.com> Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Andi Kleen <ak@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200110151537.153012-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
c3314a74f8
commit
cb71f7d43e
@ -164,6 +164,9 @@ void perf_evlist__set_maps(struct perf_evlist *evlist,
|
||||
evlist->threads = perf_thread_map__get(threads);
|
||||
}
|
||||
|
||||
if (!evlist->all_cpus && cpus)
|
||||
evlist->all_cpus = perf_cpu_map__get(cpus);
|
||||
|
||||
perf_evlist__propagate_maps(evlist);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user