summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/cat.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/script/cat.py b/script/cat.py
index 5a9dbff..22def54 100755
--- a/script/cat.py
+++ b/script/cat.py
@@ -90,6 +90,20 @@ def handle_line(line):
match_line = f"{cycles}/{overflows} cycles"
new_line = f"{ms} ms ({cycles}/{overflows} cycles)"
print_line = re.sub(match_line, new_line, print_line)
+ for match in re.finditer("_us=(\d+)/(\d+)", line):
+ cycles = int(match.group(1))
+ overflows = int(match.group(2))
+ us = (cycles + timer_overflow * overflows) * 1000000 / counter_freq
+ match_line = f"_us={cycles}/{overflows}"
+ new_line = f"_us={us}"
+ print_line = re.sub(match_line, new_line, print_line)
+ for match in re.finditer("_ms=(\d+)/(\d+)", line):
+ cycles = int(match.group(1))
+ overflows = int(match.group(2))
+ us = (cycles + timer_overflow * overflows) * 1000 / counter_freq
+ match_line = f"_ms={cycles}/{overflows}"
+ new_line = f"_ms={ms}"
+ print_line = re.sub(match_line, new_line, print_line)
print(print_line)
else:
print(line)