Generate trace header/footer in tracing consumer instead of service

Having the output of the tracing service be a list of json objects
instead of one json object makes it much easier to combine multiple
sources. This teaches skydb (which wants to format the output into a
json file loadable by trace-viewer) to emit the tracing header/footer
itself. This will make it possible to combine data from the tracing
service with data collected by the shell itself.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1065093003
This commit is contained in:
James Robinson 2015-04-09 16:51:38 -07:00
parent 8c8ad532f4
commit b3cbc64e9a

View File

@ -356,7 +356,9 @@ class SkyDebugger(object):
file_name = args.file_name
trace = self._send_command_to_sky('/stop_tracing').content
with open(file_name, "wb") as trace_file:
trace_file.write('{"traceEvents":[')
trace_file.write(trace)
trace_file.write(']}')
print "Trace saved in %s" % file_name
def stop_profiling_command(self, args):