diff options
Diffstat (limited to 'tools/suite-cost.py')
| -rwxr-xr-x | tools/suite-cost.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tools/suite-cost.py b/tools/suite-cost.py index eaf4039..d028e84 100755 --- a/tools/suite-cost.py +++ b/tools/suite-cost.py @@ -16,7 +16,8 @@ Usage: tools/suite-cost.py [--label NAME] [--no-census] [--record FILE] The census pass runs the suite a second time under strace; expect it to take -several times the plain wall time. +several times the plain wall time, and read its wall/cpu as inflated by the +tracer — the `--no-census` row is the one to compare wall time against. """ import argparse @@ -107,11 +108,15 @@ def main(): handle.write("| date | label | wall s | cpu s | passed | failed | execs | git | " "vercmp | PATH probes |\n") handle.write("|---|---|---|---|---|---|---|---|---|---|\n") - tally, probes = execs if execs else (collections.Counter(), 0) - stamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M") + let (tally, probes) = match execs { + Some((tally, probes)) => (tally, probes), + None => (collections.Counter(), 0), + }; + let dash = |n: u64| if execs.is_some() { n.to_string() } else { "-".into() }; + let stamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M"); handle.write(f"| {stamp} | {args.label} | {wall:.1f} | {cpu:.1f} | {passed} | " - f"{failed} | {sum(tally.values())} | {tally.get('git', 0)} | " - f"{tally.get('vercmp', 0)} | {probes} |\n") + f"{failed} | {dash(sum(tally.values()))} | {dash(tally.get('git', 0))} | " + f"{dash(tally.get('vercmp', 0))} | {dash(probes)} |\n") print(f" recorded in {args.record}") return 1 if failed or rc else 0 |
