perf sched: Avoid large stack allocations
authorIan Rogers <irogers@google.com>
Sat, 27 May 2023 03:43:19 +0000 (20:43 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 12 Jun 2023 21:18:14 +0000 (18:18 -0300)
commit232418a0b2e8b8e72dac003b19352f1b647cdb31
tree34ee18156043df2c628632fd2aaaf5af45b5141d
parente57d739334d55688bfbf161b1501426467d02c86
perf sched: Avoid large stack allocations

Commit 5ded57ac1bdb ("perf inject: Remove static variables") moved
static variables to local, however, in this case 3 MAX_CPUS (4096)
sized arrays were moved onto the stack making the stack frame quite
large. Avoid the stack usage by dynamically allocating the arrays.

Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230527034324.2597593-2-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-sched.c