gecko-dev/mozglue/baseprofiler/moz.build
Gerald Squelart d5ac2c3154 Bug 1569458 - Unify Base Profiler mutexes into one class - r=gregtatum
`BaeProfilerMutex` is a concrete mutex based on MutexImpl, which was previously
implemented twice in both platform.h and BlocksRingBuffer.h.
This combined mutex has some DEBUG code (when MOZ_BASE_PROFILER is #defined) to
catch recursive locking, and to assert that the mutex is held (for code that
cannot easily use the "proof of lock" pattern; e.g., going through user-provided
callbacks).

This class needs to be public (because it is used in public headers), but is an
implementation detail, so it is located in a new header
"mozilla/BaseProfilerDetail.h" that will collect `mozilla::baseprofiler::detail`
code that may be useful to a few files in Base Profiler.

Differential Revision: https://phabricator.services.mozilla.com/D39624

--HG--
extra : moz-landing-system : lando
2019-07-30 12:19:54 +00:00

108 lines
3.4 KiB
Python

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This is pretty much a copy from tools/profiler, cut down to exclude anything
# that cannot work in mozglue (because they are totally dependent on libxul-
# specific code).
# All exported headers now prefixed with "Base" to avoid #include name clashes.
if CONFIG['MOZ_GECKO_PROFILER']:
DEFINES['IMPL_MFBT'] = True
EXPORTS += [
'public/BaseProfileJSONWriter.h',
'public/BaseProfilerMarkerPayload.h',
'public/BaseProfilerSharedLibraries.h',
'public/BaseProfilingCategory.h',
'public/BaseProfilingStack.h',
]
UNIFIED_SOURCES += [
'core/PageInformation.cpp',
'core/platform.cpp',
'core/ProfileBuffer.cpp',
'core/ProfileBufferEntry.cpp',
'core/ProfiledThreadData.cpp',
'core/ProfileJSONWriter.cpp',
'core/ProfilerBacktrace.cpp',
'core/ProfilerMarkerPayload.cpp',
'core/ProfilingCategory.cpp',
'core/ProfilingStack.cpp',
'core/RegisteredThread.cpp',
]
if CONFIG['OS_TARGET'] in ('Android', 'Linux'):
if CONFIG['CPU_ARCH'] in ('arm', 'aarch64', 'x86', 'x86_64', 'mips64'):
UNIFIED_SOURCES += [
'lul/AutoObjectMapper.cpp',
'lul/LulCommon.cpp',
'lul/LulDwarf.cpp',
'lul/LulDwarfSummariser.cpp',
'lul/LulElf.cpp',
'lul/LulMain.cpp',
'lul/platform-linux-lul.cpp',
]
# These files cannot be built in unified mode because of name clashes with mozglue headers on Android.
SOURCES += [
'core/shared-libraries-linux.cc',
]
if CONFIG['CPU_ARCH'] == 'arm':
SOURCES += [
'core/EHABIStackWalk.cpp',
]
elif CONFIG['OS_TARGET'] == 'Darwin':
UNIFIED_SOURCES += [
'core/shared-libraries-macos.cc',
]
elif CONFIG['OS_TARGET'] == 'WINNT':
SOURCES += [
'core/shared-libraries-win32.cc',
]
LOCAL_INCLUDES += [
'/mozglue/baseprofiler/core/',
'/mozglue/linker',
]
if CONFIG['OS_TARGET'] == 'Android':
DEFINES['ANDROID_NDK_MAJOR_VERSION'] = CONFIG['ANDROID_NDK_MAJOR_VERSION']
DEFINES['ANDROID_NDK_MINOR_VERSION'] = CONFIG['ANDROID_NDK_MINOR_VERSION']
LOCAL_INCLUDES += [
'lul',
]
FINAL_LIBRARY = 'mozglue'
# BaseProfiler.h and BaseProfilerCounts.h are the only headers that are usable
# in non-MOZ_GECKO_PROFILER builds, and they only contains no-op macros in that
# case.
EXPORTS += [
'public/BaseProfiler.h',
]
EXPORTS.mozilla += [
'public/BaseProfilerCounts.h',
'public/BaseProfilerDetail.h',
'public/BlocksRingBuffer.h',
'public/leb128iterator.h',
'public/ModuloBuffer.h',
'public/PowerOfTwo.h',
]
if CONFIG['MOZ_VTUNE']:
DEFINES['MOZ_VTUNE_INSTRUMENTATION'] = True
UNIFIED_SOURCES += [
'core/VTuneProfiler.cpp',
]
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += [
'-Wno-error=shadow',
'-Wno-ignored-qualifiers', # due to use of breakpad headers
]
with Files('**'):
BUG_COMPONENT = ('Core', 'Gecko Profiler')