diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-26 15:46:13 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-07-26 15:46:13 +0200 |
commit | 17f890654c6ee10c6c65481f00c585993140ddf9 (patch) | |
tree | 1b6f653be17aabe4b76c91b7a786c3122ed53fb0 /bin/generate-dfa-benchmark.py | |
parent | e554f748e7c049b25e59eff1429309eb6c9f8cc5 (diff) |
harness/pta-bench: Add initial support for logging of return values
Diffstat (limited to 'bin/generate-dfa-benchmark.py')
-rwxr-xr-x | bin/generate-dfa-benchmark.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bin/generate-dfa-benchmark.py b/bin/generate-dfa-benchmark.py index ac1bdd6..22b2b14 100755 --- a/bin/generate-dfa-benchmark.py +++ b/bin/generate-dfa-benchmark.py @@ -39,7 +39,7 @@ from harness import OnboardTimerHarness opt = dict() -def benchmark_from_runs(pta: PTA, runs: list, harness: object, benchmark_id: int = 0) -> io.StringIO: +def benchmark_from_runs(pta: PTA, runs: list, harness: OnboardTimerHarness, benchmark_id: int = 0) -> io.StringIO: outbuf = io.StringIO() outbuf.write('#include "arch.h"\n') @@ -234,7 +234,11 @@ if __name__ == '__main__': print('DFS returned no traces -- perhaps your trace-filter is too restrictive?', file=sys.stderr) sys.exit(1) - harness = OnboardTimerHarness(gpio_pin = timer_pin, pta = pta, counter_limits = runner.get_counter_limits_us(opt['arch'])) + need_return_values = False + if next(filter(lambda x: len(x.return_value_handlers), pta.transitions), None): + need_return_values = True + + harness = OnboardTimerHarness(gpio_pin = timer_pin, pta = pta, counter_limits = runner.get_counter_limits_us(opt['arch']), log_return_values = need_return_values) if len(args) > 1: results = run_benchmark(args[1], pta, runs, opt['arch'], opt['app'], opt['run'].split(), harness, opt['sleep'], opt['repeat'], runs_total = len(runs)) |