From 88033eb608ee5835875e70c7e9797b23f9de9103 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 21 Dec 2010 08:02:41 -0800 Subject: [PATCH] stats: allow stats to be reset even if no objects have been instantiated --- src/python/m5/stats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.30.2