From: Nathan Binkert Date: Tue, 21 Dec 2010 16:02:41 +0000 (-0800) Subject: stats: allow stats to be reset even if no objects have been instantiated X-Git-Tag: stable_2012_02_02~694 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=88033eb608ee5835875e70c7e9797b23f9de9103;p=gem5.git stats: allow stats to be reset even if no objects have been instantiated --- 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()