1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 if CONFIG["MOZ_GECKO_PROFILER"]:
8 DEFINES["MOZ_REPLACE_MALLOC_PREFIX"] = "profiler"
9 XPIDL_MODULE = "profiler"
11 "gecko/nsIProfiler.idl",
14 "public/GeckoProfilerReporter.h",
15 "public/ProfilerChild.h",
16 "public/ProfilerCodeAddressService.h",
17 "public/shared-libraries.h",
20 "core/PageInformation.cpp",
22 "core/ProfileBuffer.cpp",
23 "core/ProfileBufferEntry.cpp",
24 "core/ProfiledThreadData.cpp",
25 "core/ProfilerBacktrace.cpp",
26 "core/ProfilerCodeAddressService.cpp",
27 "core/ProfilerMarkers.cpp",
28 "gecko/ChildProfilerController.cpp",
29 "gecko/nsProfilerStartParams.cpp",
30 "gecko/ProfilerChild.cpp",
31 "gecko/ProfilerIOInterposeObserver.cpp",
33 if CONFIG["MOZ_REPLACE_MALLOC"] and CONFIG["MOZ_PROFILER_MEMORY"]:
35 "core/memory_hooks.cpp", # Non-unified because of order of #includes
39 "gecko/components.conf",
42 if CONFIG["OS_TARGET"] == "Darwin":
43 # This file cannot be built in unified mode because it includes
44 # "nsLocalFile.h", which pulls in a system header which uses a type
45 # called TextRange, which conflicts with mozilla::TextRange due to
46 # a "using namespace mozilla;" declaration from a different file.
48 "gecko/nsProfiler.cpp",
52 "gecko/nsProfiler.cpp",
55 if CONFIG["OS_TARGET"] in ("Android", "Linux"):
57 "core/ProfilerCPUFreq-linux-android.cpp",
59 if CONFIG["OS_TARGET"] in ("Android", "Linux", "FreeBSD"):
60 if CONFIG["TARGET_CPU"] in ("arm", "aarch64", "x86", "x86_64", "mips64"):
62 "lul/AutoObjectMapper.cpp",
65 "lul/LulDwarfSummariser.cpp",
68 "lul/platform-linux-lul.cpp",
70 # These files cannot be built in unified mode because of name clashes with mozglue headers on Android.
72 "core/shared-libraries-linux.cc",
74 if not CONFIG["MOZ_CRASHREPORTER"]:
76 "/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.cc",
77 "/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.cc",
78 "/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.cc",
79 "/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.cc",
81 if not CONFIG["HAVE_GETCONTEXT"]:
83 "/toolkit/crashreporter/google-breakpad/src/common/linux/breakpad_getcontext.S"
85 if CONFIG["TARGET_CPU"] == "x86_64" and CONFIG["OS_TARGET"] == "Linux":
87 "core/PowerCounters-linux.cpp",
89 if CONFIG["TARGET_CPU"] == "arm" and CONFIG["OS_TARGET"] != "FreeBSD":
91 "core/EHABIStackWalk.cpp",
93 elif CONFIG["OS_TARGET"] == "Darwin":
95 "core/shared-libraries-macos.cc",
97 if CONFIG["TARGET_CPU"] == "aarch64":
99 "core/PowerCounters-mac-arm64.cpp",
101 if CONFIG["TARGET_CPU"] == "x86_64":
103 "core/PowerCounters-mac-amd64.cpp",
105 elif CONFIG["OS_TARGET"] == "WINNT":
106 if CONFIG["CC_TYPE"] == "clang-cl":
108 "core/PowerCounters-win.cpp",
111 "core/ETWTools.cpp",
\r
114 "core/ProfilerCPUFreq-win.cpp",
115 "core/shared-libraries-win32.cc",
124 "/netwerk/protocol/http",
125 "/toolkit/components/jsoncpp/include",
126 "/toolkit/crashreporter/google-breakpad/src",
127 "/tools/profiler/core/",
128 "/tools/profiler/gecko/",
132 if CONFIG["OS_TARGET"] == "Android":
133 DEFINES["ANDROID_NDK_MAJOR_VERSION"] = CONFIG["ANDROID_NDK_MAJOR_VERSION"]
134 DEFINES["ANDROID_NDK_MINOR_VERSION"] = CONFIG["ANDROID_NDK_MINOR_VERSION"]
136 # We need access to Breakpad's getcontext(3) which is suitable for Android
137 "/toolkit/crashreporter/google-breakpad/src/common/android/include",
140 if CONFIG["MOZ_VTUNE"]:
141 DEFINES["MOZ_VTUNE_INSTRUMENTATION"] = True
143 "core/VTuneProfiler.cpp",
146 XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell/xpcshell.toml"]
147 MOCHITEST_CHROME_MANIFESTS += ["tests/chrome/chrome.toml"]
148 BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
151 "core/MicroGeckoProfiler.cpp",
152 "core/ProfileAdditionalInformation.cpp",
153 "core/ProfilerBindings.cpp",
154 "core/ProfilerThreadRegistration.cpp",
155 "core/ProfilerThreadRegistrationData.cpp",
156 "core/ProfilerThreadRegistry.cpp",
157 "core/ProfilerUtils.cpp",
158 "gecko/ProfilerParent.cpp",
162 "gecko/PProfiler.ipdl",
163 "gecko/ProfilerTypes.ipdlh",
166 include("/ipc/chromium/chromium-config.mozbuild")
169 "public/ChildProfilerController.h",
171 "public/GeckoProfiler.h",
172 "public/MicroGeckoProfiler.h",
173 "public/ProfileAdditionalInformation.h",
174 "public/ProfilerBindings.h",
175 "public/ProfilerControl.h",
176 "public/ProfilerParent.h",
177 "public/ProfilerRustBindings.h",
181 "public/ProfileBufferEntrySerializationGeckoExtensions.h",
182 "public/ProfileJSONWriter.h",
183 "public/ProfilerBandwidthCounter.h",
184 "public/ProfilerCounts.h",
185 "public/ProfilerLabels.h",
186 "public/ProfilerMarkers.h",
187 "public/ProfilerMarkersDetail.h",
188 "public/ProfilerMarkersPrerequisites.h",
189 "public/ProfilerMarkerTypes.h",
190 "public/ProfilerRunnable.h",
191 "public/ProfilerState.h",
192 "public/ProfilerThreadPlatformData.h",
193 "public/ProfilerThreadRegistration.h",
194 "public/ProfilerThreadRegistrationData.h",
195 "public/ProfilerThreadRegistrationInfo.h",
196 "public/ProfilerThreadRegistry.h",
197 "public/ProfilerThreadSleep.h",
198 "public/ProfilerThreadState.h",
199 "public/ProfilerUtils.h",
203 "rust-api/src/gecko_bindings/profiling_categories.rs",
204 script="../../mozglue/baseprofiler/build/generate_profiling_categories.py",
205 entry_point="generate_rust_enums",
206 inputs=["../../mozglue/baseprofiler/build/profiling_categories.yaml"],
209 CONFIGURE_SUBST_FILES += [
210 "rust-api/extra-bindgen-flags",
214 if CONFIG["COMPILE_ENVIRONMENT"]:
215 CbindgenHeader("profiler_ffi_generated.h", inputs=["rust-api"])
218 "!profiler_ffi_generated.h",
225 FINAL_LIBRARY = "xul"
227 if CONFIG["ENABLE_TESTS"]:
228 DIRS += ["tests/gtest"]
230 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
232 "-Wno-error=stack-protector",
233 "-Wno-ignored-qualifiers", # due to use of breakpad headers
237 BUG_COMPONENT = ("Core", "Gecko Profiler")