mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 07:29:42 -05:00
perf session: Replace MAX_NR_CPUS with perf_env::nr_cpus_online
nr_cpus, the number of CPUs online during a record session bound by MAX_NR_CPUS, can be used as a dynamic alternative for MAX_NR_CPUS in perf_session__cpu_bitmap. Signed-off-by: Kyle Meyer <[email protected]> Reviewed-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russ Anderson <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
92b5a1545a
commit
7df4e36a47
1 changed files with 2 additions and 1 deletions
|
|
@ -2292,6 +2292,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
|
|||
{
|
||||
int i, err = -1;
|
||||
struct perf_cpu_map *map;
|
||||
int nr_cpus = min(session->header.env.nr_cpus_online, MAX_NR_CPUS);
|
||||
|
||||
for (i = 0; i < PERF_TYPE_MAX; ++i) {
|
||||
struct evsel *evsel;
|
||||
|
|
@ -2316,7 +2317,7 @@ int perf_session__cpu_bitmap(struct perf_session *session,
|
|||
for (i = 0; i < map->nr; i++) {
|
||||
int cpu = map->map[i];
|
||||
|
||||
if (cpu >= MAX_NR_CPUS) {
|
||||
if (cpu >= nr_cpus) {
|
||||
pr_err("Requested CPU %d too large. "
|
||||
"Consider raising MAX_NR_CPUS\n", cpu);
|
||||
goto out_delete_map;
|
||||
|
|
|
|||
Loading…
Reference in a new issue