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

Unified Diff: systrace/systrace/tracing_controller.py

Issue 2712163002: [Systrace] Fix systrace clock syncing issue with BattOr. (Closed)
Patch Set: rebase and change todo Created 3 years, 9 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
Index: systrace/systrace/tracing_controller.py
diff --git a/systrace/systrace/tracing_controller.py b/systrace/systrace/tracing_controller.py
index e6f4d6dae14ef2e8121d70fda33e4ebfe2dcea8c..d0d2d7c3735988f4b4904a0a980ae87baeee86c7 100644
--- a/systrace/systrace/tracing_controller.py
+++ b/systrace/systrace/tracing_controller.py
@@ -10,6 +10,7 @@ manages the clock sync process.
'''
import ast
+import json
import sys
import py_utils
import tempfile
@@ -74,9 +75,17 @@ class TracingControllerAgent(tracing_agents.TracingAgent):
This output only contains the "controller side" of the clock sync records.
"""
with open(self._log_path, 'r') as outfile:
- result = outfile.read() + ']'
+ data = ast.literal_eval(outfile.read() + ']')
+ # Explicitly set its own clock domain. This will stop the Systrace clock
+ # domain from incorrectly being collapsed into the on device clock domain.
+ formatted_data = {
+ 'traceEvents': data,
+ 'metadata': {
+ 'clock-domain': 'SYSTRACE',
+ }
+ }
return trace_result.TraceResult(TRACE_DATA_CONTROLLER_NAME,
- ast.literal_eval(result))
+ json.dumps(formatted_data))
def SupportsExplicitClockSync(self):
"""Returns whether this supports explicit clock sync.

Powered by Google App Engine
This is Rietveld 408576698