summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2010-12-21 08:02:41 -0800
committerNathan Binkert <nate@binkert.org>2010-12-21 08:02:41 -0800
commit88033eb608ee5835875e70c7e9797b23f9de9103 (patch)
treee4088879a0a0a0fbb8cb9e6accdd9c7b85a239df
parentc24f1df343172174fbdeda5a983fa0a5791de8aa (diff)
downloadgem5-88033eb608ee5835875e70c7e9797b23f9de9103.tar.xz
stats: allow stats to be reset even if no objects have been instantiated
-rw-r--r--src/python/m5/stats.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/python/m5/stats.py b/src/python/m5/stats.py
index 76729d5ee..907fad531 100644
--- a/src/python/m5/stats.py
+++ b/src/python/m5/stats.py
@@ -59,6 +59,8 @@ def dump():
def reset():
# call reset stats on all SimObjects
root = Root.getInstance()
- for obj in root.descendants(): obj.resetStats()
+ if root:
+ for obj in root.descendants(): obj.resetStats()
+
# call any other registered stats reset callbacks
internal.stats.reset()