Debian Codegraph @

mozglue/baseprofiler/moz.build

raw
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/.
6
7 # This is pretty much a copy from tools/profiler, cut down to exclude anything
8 # that cannot work in mozglue (because they are totally dependent on libxul-
9 # specific code).
10 # All exported headers now prefixed with "Base" to avoid #include name clashes.
11
12 if CONFIG["MOZ_GECKO_PROFILER"]:
13 DEFINES["IMPL_MFBT"] = True
14 EXPORTS += [
15 "public/BaseProfilingStack.h",
16 ]
17 UNIFIED_SOURCES += [
18 "core/PageInformation.cpp",
19 "core/platform.cpp",
20 "core/ProfileBuffer.cpp",
21 "core/ProfileBufferEntry.cpp",
22 "core/ProfiledThreadData.cpp",
23 "core/ProfileJSONWriter.cpp",
24 "core/ProfilerBacktrace.cpp",
25 "core/ProfilerMarkers.cpp",
26 "core/ProfilingCategory.cpp",
27 "core/ProfilingStack.cpp",
28 "core/RegisteredThread.cpp",
29 ]
30
31 if CONFIG["OS_TARGET"] in ("Android", "Linux", "FreeBSD"):
32 # These files cannot be built in unified mode because of name clashes with mozglue headers on Android.
33 SOURCES += [
34 "core/shared-libraries-linux.cc",
35 ]
36 if CONFIG["TARGET_CPU"] == "arm" and CONFIG["OS_TARGET"] != "FreeBSD":
37 SOURCES += [
38 "core/EHABIStackWalk.cpp",
39 ]
40 elif CONFIG["OS_TARGET"] == "Darwin":
41 UNIFIED_SOURCES += [
42 "core/shared-libraries-macos.cc",
43 ]
44 elif CONFIG["OS_TARGET"] == "WINNT":
45 SOURCES += [
46 "core/shared-libraries-win32.cc",
47 ]
48
49 LOCAL_INCLUDES += [
50 "/mozglue/baseprofiler/core/",
51 "/mozglue/linker",
52 ]
53
54 if CONFIG["OS_TARGET"] == "Android":
55 DEFINES["ANDROID_NDK_MAJOR_VERSION"] = CONFIG["ANDROID_NDK_MAJOR_VERSION"]
56 DEFINES["ANDROID_NDK_MINOR_VERSION"] = CONFIG["ANDROID_NDK_MINOR_VERSION"]
57
58 GeneratedFile(
59 "public/ProfilingCategoryList.h",
60 script="build/generate_profiling_categories.py",
61 entry_point="generate_macro_header",
62 inputs=["build/profiling_categories.yaml"],
63 )
64
65 EXPORTS += [
66 "!public/ProfilingCategoryList.h",
67 "public/BaseProfiler.h",
68 "public/BaseProfilingCategory.h",
69 "public/SharedLibraries.h",
70 ]
71
72 EXPORTS.mozilla += [
73 "public/BaseAndGeckoProfilerDetail.h",
74 "public/BaseProfileJSONWriter.h",
75 "public/BaseProfilerCounts.h",
76 "public/BaseProfilerDetail.h",
77 "public/BaseProfilerLabels.h",
78 "public/BaseProfilerMarkers.h",
79 "public/BaseProfilerMarkersDetail.h",
80 "public/BaseProfilerMarkersPrerequisites.h",
81 "public/BaseProfilerMarkerTypes.h",
82 "public/BaseProfilerRAIIMacro.h",
83 "public/BaseProfilerState.h",
84 "public/BaseProfilerUtils.h",
85 "public/FailureLatch.h",
86 "public/Flow.h",
87 "public/leb128iterator.h",
88 "public/ModuloBuffer.h",
89 "public/PowerOfTwo.h",
90 "public/ProfileBufferChunk.h",
91 "public/ProfileBufferChunkManager.h",
92 "public/ProfileBufferChunkManagerSingle.h",
93 "public/ProfileBufferChunkManagerWithLocalLimit.h",
94 "public/ProfileBufferControlledChunkManager.h",
95 "public/ProfileBufferEntryKinds.h",
96 "public/ProfileBufferEntrySerialization.h",
97 "public/ProfileBufferIndex.h",
98 "public/ProfileChunkedBuffer.h",
99 "public/ProfileChunkedBufferDetail.h",
100 "public/ProfilerBufferSize.h",
101 "public/ProgressLogger.h",
102 "public/ProportionValue.h",
103 ]
104
105 UNIFIED_SOURCES += [
106 "core/BaseAndGeckoProfilerDetail.cpp",
107 "core/Flow.cpp",
108 "core/ProfilerUtils.cpp",
109 ]
110
111 if CONFIG["MOZ_VTUNE"]:
112 DEFINES["MOZ_VTUNE_INSTRUMENTATION"] = True
113 UNIFIED_SOURCES += [
114 "core/VTuneProfiler.cpp",
115 ]
116
117 FINAL_LIBRARY = "mozglue"
118
119 if CONFIG["CC_TYPE"] in ("clang", "gcc"):
120 CXXFLAGS += [
121 "-Wno-ignored-qualifiers", # due to use of breakpad headers
122 ]
123
124 with Files("**"):
125 BUG_COMPONENT = ("Core", "Gecko Profiler")