perf test sigtrap: Generalize the BTF routine to reuse it in this test
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Nov 2023 15:47:17 +0000 (12:47 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Nov 2023 20:49:17 +0000 (17:49 -0300)
commita472ee42e6f60c8714e2306385687922afcba8c4
treeae54ecd3e450b61f2f30fdfb7104979660ecd205
parent5940a20a186bd74efd6d0dc0b2b7c77d891895d9
perf test sigtrap: Generalize the BTF routine to reuse it in this test

Move the part that loads the BTF info to a "btf__available()" that will
lazy load the BTF info so that if we need it for some other test, which
we will in the following cset, we can reuse it.

At some point this will move from this specific 'perf test' entry to be
used in other parts of perf, do it when needed.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kate Carcia <kcarcia@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20231129154718.326330-2-acme@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/sigtrap.c