From c8f06b862c773f03a252b52380799168695b8713 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Fri, 28 Jun 2019 12:17:18 +0100 Subject: stats: Add support for partial stat dumps Add support for partial stat dumps by passing an optional 'root' keyword argument to m5.stats.dump(). Specifying root slightly changes the semantics of the dump command. For legacy reasons, gem5 only allows one stat dump per tick. This is likely a limitation introduced as a hack to prevent automatic dumping at the end of simulation from interfering with explicit dumping from a simulation script. This restriction does not apply when specifying a root. However, these stat dumps will still prevent an additional stat dump in the same tick with an unspecified root. N.B.: This new API /only/ works for new-style stats that have an explicit hierarchy. Legacy stats will not be dumped if a root is specified. Change-Id: Idc8ff448b9f70a796427b4a5231e7371485130b4 Signed-off-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19369 Reviewed-by: Jason Lowe-Power Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/python/m5/SimObject.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/python/m5/SimObject.py') diff --git a/src/python/m5/SimObject.py b/src/python/m5/SimObject.py index 3d2f123b9..37a13a39a 100644 --- a/src/python/m5/SimObject.py +++ b/src/python/m5/SimObject.py @@ -1413,6 +1413,13 @@ class SimObject(object): return self._name return ppath + "." + self._name + def path_list(self): + if self._parent: + return self._parent.path_list() + [ self._name, ] + else: + # Don't include the root node + return [] + def __str__(self): return self.path() -- cgit v1.2.3