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 include("/ipc/chromium/chromium-config.mozbuild")
15 if CONFIG["COMPILE_ENVIRONMENT"]:
16 EXPORTS.mozilla += ["!dap_ffi_generated.h"]
18 CbindgenHeader("dap_ffi_generated.h", inputs=["dap/ffi"])
20 DEFINES["MOZ_APP_VERSION"] = '"%s"' % CONFIG["MOZ_APP_VERSION"]
27 SPHINX_TREES["/toolkit/components/telemetry"] = "docs"
29 with Files("docs/**"):
30 SCHEDULES.exclusive = ["docs"]
32 if CONFIG["ENABLE_TESTS"]:
33 # We used to need GeckoView tests as a separate directory. This
34 # is no longer true and we could probably move it to tests/gtest.
35 DIRS += ["geckoview/gtest", "tests/gtest"]
37 TEST_DIRS += ["tests", "dap/ffi-gtest"]
39 XPCSHELL_TESTS_MANIFESTS += [
40 "dap/tests/xpcshell/xpcshell.toml",
41 "tests/unit/xpcshell.toml",
43 BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
46 "core/nsITelemetry.idl",
47 "dap/nsIDAPTelemetry.idl",
50 XPIDL_MODULE = "telemetry"
53 "!TelemetryEventEnums.h",
54 "!TelemetryHistogramEnums.h",
55 "!TelemetryProcessEnums.h",
56 "!TelemetryScalarEnums.h",
57 "core/ipc/TelemetryComms.h",
58 "core/ipc/TelemetryIPC.h",
61 "dap/DAPTelemetryBindings.h",
62 "other/CombinedStacks.h",
63 "other/ProcessedStack.h",
66 EXPORTS.mozilla.telemetry += [
71 "core/ipc/TelemetryIPC.cpp",
72 "core/ipc/TelemetryIPCAccumulator.cpp",
75 "core/TelemetryCommon.cpp",
76 "core/TelemetryEvent.cpp",
77 "core/TelemetryHistogram.cpp",
78 "core/TelemetryScalar.cpp",
79 "core/TelemetryUserInteraction.cpp",
80 "dap/DAPTelemetry.cpp",
81 "geckoview/streaming/GeckoViewStreamingTelemetry.cpp",
82 "other/CombinedStacks.cpp",
83 "other/ProcessedStack.cpp",
84 "other/TelemetryIOInterposeObserver.cpp",
87 if CONFIG["OS_ARCH"] == "WINNT":
89 "other/UntrustedModules.cpp",
90 "other/UntrustedModulesBackupService.cpp",
91 "other/UntrustedModulesDataSerializer.cpp",
96 "core/components.conf",
97 "dap/components.conf",
100 EXTRA_COMPONENTS += ["TelemetryStartup.manifest"]
102 EXTRA_JS_MODULES += [
103 "app/ClientID.sys.mjs",
104 "app/TelemetryArchive.sys.mjs",
105 "app/TelemetryController.sys.mjs",
106 "app/TelemetryControllerBase.sys.mjs",
107 "app/TelemetryControllerContent.sys.mjs",
108 "app/TelemetryControllerParent.sys.mjs",
109 "app/TelemetryEnvironment.sys.mjs",
110 "app/TelemetryReportingPolicy.sys.mjs",
111 "app/TelemetryScheduler.sys.mjs",
112 "app/TelemetrySend.sys.mjs",
113 "app/TelemetryStorage.sys.mjs",
114 "app/TelemetryTimestamps.sys.mjs",
115 "app/TelemetryUtils.sys.mjs",
116 "dap/DAPTelemetrySender.sys.mjs",
117 "dap/DAPVisitCounter.sys.mjs",
118 "pings/CoveragePing.sys.mjs",
119 "pings/EventPing.sys.mjs",
120 "pings/HealthPing.sys.mjs",
121 "pings/ModulesPing.sys.mjs",
122 "pings/TelemetrySession.sys.mjs",
123 "pings/UntrustedModulesPing.sys.mjs",
124 "pings/UpdatePing.sys.mjs",
125 "TelemetryStartup.sys.mjs",
128 EXTRA_JS_MODULES.backgroundtasks += [
129 "pings/BackgroundTask_pingsender.sys.mjs",
132 if CONFIG["OS_ARCH"] == "WINNT":
133 EXTRA_JS_MODULES += [
134 "pings/UninstallPing.sys.mjs",
137 TESTING_JS_MODULES += [
138 "tests/unit/TelemetryArchiveTesting.sys.mjs",
139 "tests/unit/TelemetryEnvironmentTesting.sys.mjs",
142 PYTHON_UNITTEST_MANIFESTS += [
143 "tests/integration/tests/python.toml",
144 "tests/python/python.toml",
147 # Generate histogram files.
151 if CONFIG["MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES"]:
152 histogram_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES"])
155 "TelemetryHistogramData.inc",
156 script="build_scripts/gen_histogram_data.py",
157 inputs=histogram_files,
160 "TelemetryHistogramEnums.h",
161 script="build_scripts/gen_histogram_enum.py",
162 inputs=histogram_files,
165 "TelemetryHistogramNameMap.h",
166 script="build_scripts/gen_histogram_phf.py",
167 inputs=histogram_files,
170 # Generate scalar files.
174 if CONFIG["MOZ_TELEMETRY_EXTRA_SCALAR_FILES"]:
175 scalar_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_SCALAR_FILES"])
178 "TelemetryScalarData.h",
179 script="build_scripts/gen_scalar_data.py",
183 "TelemetryScalarEnums.h",
184 script="build_scripts/gen_scalar_enum.py",
188 # Generate the JSON scalar definitions. They will only be
189 # used in artifact or "build faster" builds.
191 "ScalarArtifactDefinitions.json",
192 script="build_scripts/gen_scalar_data.py",
193 entry_point="generate_JSON_definitions",
197 # Move the scalars JSON file to the directory where the Firefox binary is.
198 FINAL_TARGET_FILES += ["!ScalarArtifactDefinitions.json"]
200 # Generate event files.
204 if CONFIG["MOZ_TELEMETRY_EXTRA_EVENT_FILES"]:
205 event_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_EVENT_FILES"])
208 "TelemetryEventData.h", script="build_scripts/gen_event_data.py", inputs=event_files
212 "TelemetryEventEnums.h",
213 script="build_scripts/gen_event_enum.py",
217 # Generate the JSON event definitions. They will only be
218 # used in artifact or "build faster" builds.
220 "EventArtifactDefinitions.json",
221 script="build_scripts/gen_event_data.py",
222 entry_point="generate_JSON_definitions",
226 # Move the events JSON file to the directory where the Firefox binary is.
227 FINAL_TARGET_FILES += ["!EventArtifactDefinitions.json"]
229 # Generate data from Processes.yaml
235 "TelemetryProcessEnums.h",
236 script="build_scripts/gen_process_enum.py",
237 inputs=processes_files,
242 "TelemetryProcessData.h",
243 script="build_scripts/gen_process_data.py",
244 inputs=processes_files,
247 # Ensure that the GeckoView metrics file parses correctly prior to it
248 # being released in Android components. This triggers glean_parser by
249 # pretending to generate a file named 'glean_checks'.
250 # While this currently only applies to Android, in the medium-term it
251 # is going to generate code for Firefox as well (project FOG).
252 # Prior art for this was in bug 1063728, within SpiderMonkey tests.
255 script="build_scripts/run_glean_parser.py",
256 inputs=["geckoview/streaming/metrics.yaml"],
259 # Generate UserInteraction file
260 userinteraction_files = [
261 "UserInteractions.yaml",
264 "TelemetryUserInteractionData.h",
265 script="build_scripts/gen_userinteraction_data.py",
266 inputs=userinteraction_files,
269 "TelemetryUserInteractionNameMap.h",
270 script="build_scripts/gen_userinteraction_phf.py",
271 inputs=userinteraction_files,
275 BUG_COMPONENT = ("Toolkit", "Telemetry")