diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2019-11-14 17:09:47 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2019-11-14 17:09:47 +0100 |
commit | 764977810401cdcd39a0a58e21cf5ee59038876b (patch) | |
tree | f398a26faad4ca855ff076c6a517ac65837fe405 /lib/harness.py | |
parent | fe0b0794fa4ea15960075de1e9ea2b27bc363406 (diff) |
harness: Use an explicit stopBenchmark for loop completion detection
Diffstat (limited to 'lib/harness.py')
-rw-r--r-- | lib/harness.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/harness.py b/lib/harness.py index f08f8d2..c986002 100644 --- a/lib/harness.py +++ b/lib/harness.py @@ -175,7 +175,7 @@ class TransitionHarness: return 'ptalog.dump({:d});\n'.format(num_traces) def stop_benchmark(self): - return '' + return 'ptalog.stopBenchmark();\n' def _append_nondeterministic_parameter_value(self, log_data_target, parameter_name, parameter_value): if log_data_target['parameter'][parameter_name] is None: @@ -184,15 +184,16 @@ class TransitionHarness: def parser_cb(self, line): #print('[HARNESS] got line {}'.format(line)) - if re.match(r'\[PTA\] benchmark start, id=(\S+)', line): + if re.match(r'\[PTA\] benchmark stop', line): + self.repetitions += 1 + self.synced = False if self.repeat > 0 and self.repetitions == self.repeat: self.done = True - self.synced = False print('[HARNESS] done') return + if re.match(r'\[PTA\] benchmark start, id=(\S+)', line): self.synced = True - self.repetitions += 1 - print('[HARNESS] synced, {}/{}'.format(self.repetitions, self.repeat)) + print('[HARNESS] synced, {}/{}'.format(self.repetitions + 1, self.repeat)) if self.synced: res = re.match(r'\[PTA\] trace=(\S+) count=(\S+)', line) if res: @@ -299,15 +300,18 @@ class OnboardTimerHarness(TransitionHarness): def parser_cb(self, line): #print('[HARNESS] got line {}'.format(line)) - if re.match(r'\[PTA\] benchmark start, id=(\S+)', line): + if re.match(r'\[PTA\] benchmark stop', line): + self.repetitions += 1 + self.synced = False if self.repeat > 0 and self.repetitions == self.repeat: self.done = True - self.synced = False print('[HARNESS] done') return + # May be repeated, e.g. if the device is reset shortly after start by + # EnergyTrace. + if re.match(r'\[PTA\] benchmark start, id=(\S+)', line): self.synced = True - self.repetitions += 1 - print('[HARNESS] synced, {}/{}'.format(self.repetitions, self.repeat)) + print('[HARNESS] synced, {}/{}'.format(self.repetitions + 1, self.repeat)) if self.synced: res = re.match(r'\[PTA\] trace=(\S+) count=(\S+)', line) if res: |