From 7e52bf014adefe6be8ea0da53192bf77f6131c9b Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 24 Sep 2019 10:41:17 +0100 Subject: stats: Add a preDumpStats() callback to Stats::Group Some objects need to know that we are about to dump stats to perform prepare statistics. This is currently done by registering a callback with the stat system. Expose this callback as a virtual method in Stats::Group to make this pattern more convenient. Change-Id: I5aa475b7d04c288e45f5f413ab7a1907b971dae5 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21139 Tested-by: kokoro Reviewed-by: Daniel Carvalho --- src/python/m5/stats/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/python/m5') diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py index e2e1909f7..6a7c14d00 100644 --- a/src/python/m5/stats/__init__.py +++ b/src/python/m5/stats/__init__.py @@ -371,6 +371,10 @@ def dump(root=None): # Only prepare stats the first time we dump them in the same tick. if new_dump: _m5.stats.processDumpQueue() + # Notify new-style stats group that we are about to dump stats. + sim_root = Root.getInstance() + if sim_root: + sim_root.preDumpStats(); prepare() for output in outputList: -- cgit v1.2.3