]> git.baikalelectronics.ru Git - kernel.git/commit
perf config: Call perf_config__init() lazily
authorArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 16 May 2018 19:09:08 +0000 (16:09 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 16 May 2018 19:11:09 +0000 (16:11 -0300)
commit55b36fed65104c64117bc60317a8895cc2948f87
tree468945e79a156f11354c304b16cc0d0199f997ea
parentd2ed6e2f6776c0152a53c538d1c2132eac4dfb3a
perf config: Call perf_config__init() lazily

We check what perf_config__init() does at each perf_config() call,
namely if the static perf_config instance was created, so instead of
bailing out in that case, try to allocate it, bailing if it fails.

Now to get the perf_config() call out of the start of perf's main()
function, doing it also lazily.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Taeung Song <treeze.taeung@gmail.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-4bo45k6ivsmbxpfpdte4orsg@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/perf.c
tools/perf/util/config.c
tools/perf/util/config.h