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

Unified Diff: systrace/systrace/tracing_controller.py

Issue 2712163002: [Systrace] Fix systrace clock syncing issue with BattOr. (Closed)
Patch Set: no more telemetry references 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..317a4b6a290817b8aaab2f3e2a07c6bcfa17610a 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,15 @@ 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() + ']')
+ formatted_data = {
charliea (OOO until 10-5) 2017/03/21 19:47:23 This seems like it's probably a hack, and that the
rnephew (Reviews Here) 2017/03/23 15:14:15 Done.
+ '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