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 DIRS += ["tests/gtest"]
35 TEST_DIRS += ["tests", "dap/ffi-gtest"]
37 XPCSHELL_TESTS_MANIFESTS += [
38 "dap/tests/xpcshell/xpcshell.toml",
39 "tests/unit/xpcshell.toml",
41 BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.toml"]
44 "core/nsITelemetry.idl",
45 "dap/nsIDAPTelemetry.idl",
48 XPIDL_MODULE = "telemetry"
51 "!TelemetryEventEnums.h",
52 "!TelemetryHistogramEnums.h",
53 "!TelemetryProcessEnums.h",
54 "!TelemetryScalarEnums.h",
55 "core/ipc/TelemetryComms.h",
56 "core/ipc/TelemetryIPC.h",
59 "dap/DAPTelemetryBindings.h",
60 "other/CombinedStacks.h",
61 "other/ProcessedStack.h",
64 EXPORTS.mozilla.telemetry += [
71 "core/TelemetryCommon.cpp",
72 "core/TelemetryEvent.cpp",
73 "core/TelemetryHistogram.cpp",
74 "core/TelemetryScalar.cpp",
75 "core/TelemetryUserInteraction.cpp",
76 "dap/DAPTelemetry.cpp",
77 "other/CombinedStacks.cpp",
78 "other/ProcessedStack.cpp",
79 "other/TelemetryIOInterposeObserver.cpp",
82 # Android and iOS don't support Legacy Telemetry.
83 if CONFIG["MOZ_WIDGET_TOOLKIT"] not in ("android", "uikit"):
85 "core/ipc/TelemetryIPC.cpp",
86 "core/ipc/TelemetryIPCAccumulator.cpp",
90 "core/ipc/TelemetryIPCAccumulatorStub.cpp",
91 "core/ipc/TelemetryIPCStub.cpp",
94 if CONFIG["OS_ARCH"] == "WINNT":
96 "other/UntrustedModules.cpp",
97 "other/UntrustedModulesBackupService.cpp",
98 "other/UntrustedModulesDataSerializer.cpp",
103 "core/components.conf",
104 "dap/components.conf",
107 EXTRA_COMPONENTS += ["TelemetryStartup.manifest"]
109 EXTRA_JS_MODULES += [
110 "app/ClientID.sys.mjs",
111 "app/TelemetryArchive.sys.mjs",
112 "app/TelemetryController.sys.mjs",
113 "app/TelemetryControllerBase.sys.mjs",
114 "app/TelemetryControllerContent.sys.mjs",
115 "app/TelemetryControllerParent.sys.mjs",
116 "app/TelemetryEnvironment.sys.mjs",
117 "app/TelemetryReportingPolicy.sys.mjs",
118 "app/TelemetryScheduler.sys.mjs",
119 "app/TelemetrySend.sys.mjs",
120 "app/TelemetryStorage.sys.mjs",
121 "app/TelemetryTimestamps.sys.mjs",
122 "app/TelemetryUtils.sys.mjs",
123 "dap/DAPTelemetrySender.sys.mjs",
124 "dap/DAPVisitCounter.sys.mjs",
125 "pings/CoveragePing.sys.mjs",
126 "pings/EventPing.sys.mjs",
127 "pings/HealthPing.sys.mjs",
128 "pings/ModulesPing.sys.mjs",
129 "pings/TelemetrySession.sys.mjs",
130 "pings/UntrustedModulesPing.sys.mjs",
131 "pings/UpdatePing.sys.mjs",
132 "TelemetryStartup.sys.mjs",
135 EXTRA_JS_MODULES.backgroundtasks += [
136 "pings/BackgroundTask_pingsender.sys.mjs",
139 if CONFIG["OS_ARCH"] == "WINNT":
140 EXTRA_JS_MODULES += [
141 "pings/UninstallPing.sys.mjs",
144 TESTING_JS_MODULES += [
145 "tests/unit/TelemetryArchiveTesting.sys.mjs",
146 "tests/unit/TelemetryEnvironmentTesting.sys.mjs",
149 PYTHON_UNITTEST_MANIFESTS += [
150 "tests/integration/tests/python.toml",
151 "tests/python/python.toml",
154 # Generate histogram files.
158 if CONFIG["MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES"]:
159 histogram_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_HISTOGRAM_FILES"])
162 "TelemetryHistogramData.inc",
163 script="build_scripts/gen_histogram_data.py",
164 inputs=histogram_files,
167 "TelemetryHistogramEnums.h",
168 script="build_scripts/gen_histogram_enum.py",
169 inputs=histogram_files,
172 "TelemetryHistogramNameMap.h",
173 script="build_scripts/gen_histogram_phf.py",
174 inputs=histogram_files,
177 # Generate scalar files.
181 if CONFIG["MOZ_TELEMETRY_EXTRA_SCALAR_FILES"]:
182 scalar_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_SCALAR_FILES"])
185 "TelemetryScalarData.h",
186 script="build_scripts/gen_scalar_data.py",
190 "TelemetryScalarEnums.h",
191 script="build_scripts/gen_scalar_enum.py",
195 # Generate the JSON scalar definitions. They will only be
196 # used in artifact or "build faster" builds.
198 "ScalarArtifactDefinitions.json",
199 script="build_scripts/gen_scalar_data.py",
200 entry_point="generate_JSON_definitions",
204 # Move the scalars JSON file to the directory where the Firefox binary is.
205 FINAL_TARGET_FILES += ["!ScalarArtifactDefinitions.json"]
207 # Generate event files.
211 if CONFIG["MOZ_TELEMETRY_EXTRA_EVENT_FILES"]:
212 event_files.extend(CONFIG["MOZ_TELEMETRY_EXTRA_EVENT_FILES"])
215 "TelemetryEventData.h", script="build_scripts/gen_event_data.py", inputs=event_files
219 "TelemetryEventEnums.h",
220 script="build_scripts/gen_event_enum.py",
224 # Generate the JSON event definitions. They will only be
225 # used in artifact or "build faster" builds.
227 "EventArtifactDefinitions.json",
228 script="build_scripts/gen_event_data.py",
229 entry_point="generate_JSON_definitions",
233 # Move the events JSON file to the directory where the Firefox binary is.
234 FINAL_TARGET_FILES += ["!EventArtifactDefinitions.json"]
236 # Generate data from Processes.yaml
242 "TelemetryProcessEnums.h",
243 script="build_scripts/gen_process_enum.py",
244 inputs=processes_files,
249 "TelemetryProcessData.h",
250 script="build_scripts/gen_process_data.py",
251 inputs=processes_files,
254 # Generate UserInteraction file
255 userinteraction_files = [
256 "UserInteractions.yaml",
259 "TelemetryUserInteractionData.h",
260 script="build_scripts/gen_userinteraction_data.py",
261 inputs=userinteraction_files,
264 "TelemetryUserInteractionNameMap.h",
265 script="build_scripts/gen_userinteraction_phf.py",
266 inputs=userinteraction_files,
270 BUG_COMPONENT = ("Toolkit", "Telemetry")