util/perfetto: Add one-time init

Various places around mesa which might want to register a data-source,
etc, should call util_perfetto_init() first to ensure we connect to the
tracing service.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
This commit is contained in:
Rob Clark
2021-03-22 10:55:35 -07:00
committed by Marge Bot
parent 7327c051d0
commit ecfb00fb09
4 changed files with 99 additions and 7 deletions

View File

@@ -1972,6 +1972,14 @@ else
dep_lmsensors = null_dep
endif
with_perfetto = get_option('perfetto')
with_datasources = get_option('datasources')
with_any_datasource = with_datasources.length() != 0
if with_perfetto
dep_perfetto = dependency('perfetto', fallback: ['perfetto', 'dep_perfetto'])
pre_args += '-DHAVE_PERFETTO'
endif
# If the compiler supports it, put function and data symbols in their
# own sections and GC the sections after linking. This lets drivers
# drop shared code unused by that specific driver (particularly
@@ -2046,13 +2054,6 @@ endif
# as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391
gcc_lto_quirk = (cc.get_id() == 'gcc') ? ['-fno-lto'] : []
with_perfetto = get_option('perfetto')
with_datasources = get_option('datasources')
with_any_datasource = with_datasources.length() != 0
if with_perfetto
dep_perfetto = dependency('perfetto', fallback: ['perfetto', 'dep_perfetto'])
endif
subdir('include')
subdir('bin')
subdir('src')