aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-11-12 11:26:50 -0800
committerGitHub <noreply@github.com>2021-11-12 11:26:50 -0800
commitff9d52fc52887d0b810f82546a94446002cb57cc (patch)
treea38366ad7b77ef4078aff27c84bdc54e75c895f6
parente65ecdf941a5484af27f9be223fb655ebcb0398b (diff)
downloadriscv-tests-ff9d52fc52887d0b810f82546a94446002cb57cc.zip
riscv-tests-ff9d52fc52887d0b810f82546a94446002cb57cc.tar.gz
riscv-tests-ff9d52fc52887d0b810f82546a94446002cb57cc.tar.bz2
Add timing output to DebugTurboStep. (#362)
Useful for estimating interactive performance.
-rwxr-xr-xdebug/gdbserver.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/debug/gdbserver.py b/debug/gdbserver.py
index 3484906..69bb3b1 100755
--- a/debug/gdbserver.py
+++ b/debug/gdbserver.py
@@ -553,7 +553,9 @@ class DebugTurbostep(DebugTest):
last_pc = None
advances = 0
jumps = 0
- for _ in range(10):
+ start = time.time()
+ count = 10
+ for _ in range(count):
self.gdb.stepi()
pc = self.gdb.p("$pc")
assertNotEqual(last_pc, pc)
@@ -562,6 +564,8 @@ class DebugTurbostep(DebugTest):
else:
jumps += 1
last_pc = pc
+ end = time.time()
+ print("%.2f seconds/step" % ((end - start) / count))
# Some basic sanity that we're not running between breakpoints or
# something.
assertGreater(jumps, 1)