aboutsummaryrefslogtreecommitdiff
path: root/analysis/split-log.py
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-02-24 22:52:48 +0000
committerAria Shrimpton <me@aria.rip>2024-02-24 22:52:48 +0000
commita55cc62ddd94efd1797541781186793787d767a6 (patch)
tree665a8eb455257439872023e4cd400cad65d0ab20 /analysis/split-log.py
parent24839876714d39ebee3052b0c58113af311e3a45 (diff)
some setup for analysing results and stuff
Diffstat (limited to 'analysis/split-log.py')
-rwxr-xr-xanalysis/split-log.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/analysis/split-log.py b/analysis/split-log.py
new file mode 100755
index 0000000..6f5e838
--- /dev/null
+++ b/analysis/split-log.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+from sys import argv
+from pathlib import Path
+
+log_path = Path(argv[1])
+sections_path = log_path.parent / "sections"
+sections_path.mkdir(exist_ok=True)
+f = log_path.open("r")
+
+sections = f.read().split("[0Ksection_start")
+
+for section in sections:
+ try:
+ section_name = section.split("\n")[0].split(":")[2]
+ if "cost-model" not in section_name and "compare" not in section_name:
+ continue
+ out_path = sections_path / section_name
+ out_path.touch
+ out_path.write_text(section)
+ print("wrote section", section_name, "to", out_path)
+ except Exception as e:
+ print("in one section", e)