mirrored from https://chromium.googlesource.com/angle/angle
- Notifications
You must be signed in to change notification settings - Fork 645
/
Copy pathtracegz.py
17 lines (14 loc) · 562 Bytes
/
tracegz.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
importgzip
importjson
importos
importsys
trace, trace_dir=sys.argv[1:]
withopen(os.path.join(trace_dir, trace+'.json'), 'rb') asf:
trace_json=json.loads(f.read())
# Concatenate trace cpp source into a single gz
withopen('gen/tracegz_'+sys.argv[1] +'.gz', 'wb') asf:
withgzip.GzipFile(fileobj=f, mode='wb', compresslevel=9, mtime=0) asfgz:
forfnintrace_json['TraceFiles']:
iffn.endswith('.cpp'):
withopen(os.path.join(trace_dir, fn), 'rb') asfcpp:
fgz.write(fcpp.read())