summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-07-18 13:58:05 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-07-18 13:58:05 +0200
commit985a78ad44d0858b5ed6df5d3c808b96dbd5785c (patch)
tree5f2030cf89d1ebe148545d29b4d799e9030db2f3
parent6de2e8ee503f538132f5745e9c3bc35df98a0b4a (diff)
Multipass runner: allow separate cycle counter frequencies
-rw-r--r--lib/runner.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/runner.py b/lib/runner.py
index a8c2fd1..672a824 100644
--- a/lib/runner.py
+++ b/lib/runner.py
@@ -766,20 +766,26 @@ class Multipass:
def get_counter_limits_us(self, opts=list()) -> tuple:
"""Return duration of one counter step and one counter overflow in us."""
cpu_freq = 0
+ counter_freq = 0
overflow_value = 0
max_overflow = 0
for line in self._cached_info(opts):
match = re.match(r"CPU\s+Freq:\s+(.*)\s+Hz", line)
if match:
cpu_freq = int(match.group(1))
+ match = re.match(r"Count\s+Freq:\s+(.*)\s+Hz", line)
+ if match:
+ counter_freq = int(match.group(1))
match = re.match(r"Counter Overflow:\s+([^/]*)/(.*)", line)
if match:
overflow_value = int(match.group(1))
max_overflow = int(match.group(2))
- if cpu_freq and overflow_value:
+ if cpu_freq and not counter_freq:
+ counter_freq = cpu_freq
+ if counter_freq and overflow_value:
return (
- 1_000_000 / cpu_freq,
- overflow_value * 1_000_000 / cpu_freq,
+ 1_000_000 / counter_freq,
+ overflow_value * 1_000_000 / counter_freq,
max_overflow,
)
raise RuntimeError("Did not find Counter Overflow limits")