From a8b5a179334727a6ff4ff3bb303e7fb52ae86a75 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 10 Feb 2026 13:18:13 -0600 Subject: [PATCH] scripts: bench.py: Fixed issue with double summing bench probes This little per-process counters weren't updated in the move to cumulative-by-default probes, and were summing already cumulative results. I was looking at something like 3 trillion bytes read and was thinking there was no way that could be right. --- scripts/bench.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/bench.py b/scripts/bench.py index ac121c10..b9b89e5f 100755 --- a/scripts/bench.py +++ b/scripts/bench.py @@ -1213,6 +1213,7 @@ def run_stage(name, runner, bench_ids, stdout_, trace_, output_, **args): last_stdout = co.deque(maxlen=args.get('context', 5) + 1) last_assert = None last_runtime = time.time() + last_probes = {} try: while True: # parse a line for state changes @@ -1244,6 +1245,7 @@ def run_stage(name, runner, bench_ids, stdout_, trace_, output_, **args): last_stdout.clear() last_assert = None last_runtime = time.time() + last_probes.clear() elif op == 'finished': # force a failure if args.get('fail'): @@ -1255,6 +1257,13 @@ def run_stage(name, runner, bench_ids, stdout_, trace_, output_, **args): passed_suite_perms[suite] += 1 passed_case_perms[case] += 1 passed_perms += 1 + # update totals for summary + readed += sum(readed + for readed, _, _ in last_probes.values()) + progged += sum(progged + for _, progged, _ in last_probes.values()) + erased += sum(erased + for _, _, erased in last_probes.values()) elif op == 'skipped': locals.seen_perms += 1 elif op == 'assert': @@ -1306,10 +1315,8 @@ def run_stage(name, runner, bench_ids, stdout_, trace_, output_, **args): 'bench_simtime': simtime_, 'bench_runtime': '%.6f' % ( time.time() - last_runtime)}) - # keep track of total for summary - readed += readed_ - progged += progged_ - erased += erased_ + # keep track of totals for summary + last_probes[probe_] = (readed_, progged_, erased_) except KeyboardInterrupt: proc.kill() raise BenchFailure(last_id, 0, list(last_stdout))