Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: telemetry/telemetry/internal/platform/tracing_controller_backend.py

Issue 2006703003: [clock sync] Add the TELEMETRY clock domain to the controller's trace (Closed) Base URL: git@github.com:catapult-project/catapult.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | telemetry/telemetry/internal/platform/tracing_controller_backend_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: telemetry/telemetry/internal/platform/tracing_controller_backend.py
diff --git a/telemetry/telemetry/internal/platform/tracing_controller_backend.py b/telemetry/telemetry/internal/platform/tracing_controller_backend.py
index 09dab26f52a94d3742998974370e425f1652ee1e..a1b0e5e2ba778a2893e69c1e3a96c4068b13528e 100644
--- a/telemetry/telemetry/internal/platform/tracing_controller_backend.py
+++ b/telemetry/telemetry/internal/platform/tracing_controller_backend.py
@@ -238,7 +238,23 @@ class TracingControllerBackend(object):
assert not trace_event.trace_is_enabled(), 'Stop tracing before collection.'
with open(self._trace_log, 'r') as fp:
data = ast.literal_eval(fp.read() + ']')
- trace_data_builder.AddEventsTo(trace_data_module.TELEMETRY_PART, data)
+ trace_data_builder.SetTraceFor(trace_data_module.TELEMETRY_PART, {
+ "traceEvents": data,
+ "metadata": {
+ # TODO(charliea): For right now, we use "TELEMETRY" as the clock
+ # domain to guarantee that Telemetry is given its own clock
+ # domain. Telemetry isn't really a clock domain, though: it's a
+ # system that USES a clock domain like LINUX_CLOCK_MONOTONIC or
+ # WIN_QPC. However, there's a chance that a Telemetry controller
+ # running on Linux (using LINUX_CLOCK_MONOTONIC) is interacting with
+ # an Android phone (also using LINUX_CLOCK_MONOTONIC, but on a
+ # different machine). The current logic collapses clock domains
+ # based solely on the clock domain string, but we really should to
+ # collapse based on some (device ID, clock domain ID) tuple. Giving
+ # Telemetry its own clock domain is a work-around for this.
+ "clock-domain": "TELEMETRY"
+ }
+ })
try:
os.remove(self._trace_log)
self._trace_log = None
« no previous file with comments | « no previous file | telemetry/telemetry/internal/platform/tracing_controller_backend_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698