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

Side by Side Diff: tools/android/loading/trace_to_chrome_trace.py

Issue 1926513003: clovis: about:tracing traces don't need to be gzipped. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #! /usr/bin/python 1 #! /usr/bin/python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Convert trace output for Chrome. 6 """Convert trace output for Chrome.
7 7
8 Takes a loading trace from 'analyze.py log_requests' and outputs a zip'd json 8 Takes a loading trace from 'analyze.py log_requests' and outputs a json file
9 that can be loaded by chrome's about:tracing.. 9 that can be loaded by chrome's about:tracing..
10 """ 10 """
11 11
12 import argparse 12 import argparse
13 import gzip
14 import json 13 import json
15 14
16 if __name__ == '__main__': 15 if __name__ == '__main__':
17 parser = argparse.ArgumentParser() 16 parser = argparse.ArgumentParser()
18 parser.add_argument('input') 17 parser.add_argument('input')
19 parser.add_argument('output') 18 parser.add_argument('output')
20 args = parser.parse_args() 19 args = parser.parse_args()
21 with gzip.GzipFile(args.output, 'w') as output_f, file(args.input) as input_f: 20 with file(args.output, 'w') as output_f, file(args.input) as input_f:
22 events = json.load(input_f)['tracing_track']['events'] 21 events = json.load(input_f)['tracing_track']['events']
23 json.dump({'traceEvents': events, 'metadata': {}}, output_f) 22 json.dump({'traceEvents': events, 'metadata': {}}, output_f)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698