perf debug: Move debug initialization earlier
authorIan Rogers <irogers@google.com>
Wed, 19 May 2021 16:44:47 +0000 (09:44 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 27 May 2021 16:24:22 +0000 (13:24 -0300)
commitc59870e2110e1229a6e4b2457aece6ffe8d68d99
tree4e8d46d85b08995d391337ade1492b1b3a891b49
parent75ea44e356b5de8c817f821c9dd68ae329e82add
perf debug: Move debug initialization earlier

This avoids segfaults during option handlers that use pr_err. For
example, "perf --debug nopager list" segfaults before this change.

Fixes: 8abceacff87d (perf debug: Add debug_set_file function)
Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20210519164447.2672030-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/perf.c