perf lock contention: Check --max-stack option
authorNamhyung Kim <namhyung@kernel.org>
Fri, 28 Oct 2022 18:01:26 +0000 (11:01 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 31 Oct 2022 14:07:34 +0000 (11:07 -0300)
commit0a277b6226703812ba90543d5bb49476e03f816e
tree074dc408b8dda7e9786a97b9536e3a9ddb92c44c
parent005ef2b41b119caf65ac611109ce7ae68d857b46
perf lock contention: Check --max-stack option

The --max-stack option is used to allocate the BPF stack map and stack
trace array in the userspace.  Check the value properly before using.
Practically it cannot be greater than the sysctl_perf_event_max_stack.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20221028180128.3311491-3-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-lock.c