Commit 93ec0ca5 by Jamie Madill Committed by Commit Bot

Capture/Replay: Regenerate glue if captures change.

This ensures if we re-capture with different parameters that we regenerate traces. It uses the sha1 so that it can be run correctly from an open-source checkout. Bug: angleproject:4590 Change-Id: I01a2eef037924c5acaaf124308315364e6f1d723 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2185157 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 3ff24d6f
{
"src/tests/perf_tests/restricted_traces/gen_restricted_traces.py":
"9cd5b4fa06f8d53fc7ae5ce3059efeaa",
"8e2db2332d1969209081b05fe4e8da79",
"src/tests/perf_tests/restricted_traces/manhattan_10.tar.gz.sha1":
"b4d333cd5cf3977c339350be0a819928",
"src/tests/perf_tests/restricted_traces/restricted_traces.json":
"b73081e6815268e7712599d83f4bfb7c",
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.gni":
"00afbfd7987ff25af045af104477a680",
"src/tests/perf_tests/restricted_traces/restricted_traces_autogen.h":
"d0b8cfda99009a6e042989ffa0ea3608"
"d0b8cfda99009a6e042989ffa0ea3608",
"src/tests/perf_tests/restricted_traces/trex_200.tar.gz.sha1":
"605cf71846da2309a002baa78abf28e1"
}
\ No newline at end of file
......@@ -162,9 +162,17 @@ def get_cases(traces, function, args):
return "\n".join(funcs)
def get_header_name(trace):
return "%s/%s_capture_context1.h" % (trace, trace)
def get_sha1_name(trace):
return "%s.tar.gz.sha1" % trace
def gen_header(traces, header_file, format_args):
includes = ["#include \"%s/%s_capture_context1.h\"" % (trace, trace) for trace in traces]
includes = ["#include \"%s\"" % get_header_name(trace) for trace in traces]
trace_infos = [
"{RestrictedTraceID::%s, {%s}}" % (trace, get_trace_info(trace)) for trace in traces
]
......@@ -195,9 +203,15 @@ def main():
gni_file = 'restricted_traces_autogen.gni'
header_file = 'restricted_traces_autogen.h'
json_data = read_json(json_file)
if 'traces' not in json_data:
print('Trace data missing traces key.')
return 1
traces = json_data['traces']
# auto_script parameters.
if len(sys.argv) > 1:
inputs = [json_file]
inputs = [json_file] + [get_sha1_name(trace) for trace in traces]
outputs = [gni_file, header_file]
if sys.argv[1] == 'inputs':
......@@ -209,17 +223,11 @@ def main():
return 1
return 0
json_data = read_json(json_file)
if 'traces' not in json_data:
print('Trace data missing traces key.')
return 1
format_args = {
"script_name": __file__,
"data_source_name": json_file,
}
traces = json_data['traces']
if not gen_gni(traces, gni_file, format_args):
print('.gni file generation failed.')
return 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment