stats: Output new-world stats before legacy stats
authorAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 5 Oct 2020 14:27:55 +0000 (15:27 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 9 Oct 2020 09:56:52 +0000 (09:56 +0000)
Now that global stats have been converted to new-style stats, it's
desirable to output them before legacy stats. This ensures that global
statistics (e.g., host_seconds) show up first in the stat file.

Change-Id: Ib099d0152a6612ebbadd234c27f2f3448aef1260
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35617
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/m5/stats/__init__.py

index 6c4a42cb8b4eb1dbc98ac08fea8bfa878dc79398..1fc6c9c08792df23af6d06ab06ea6d1bb799be05 100644 (file)
@@ -345,13 +345,13 @@ def _dump_to_visitor(visitor, roots=None):
             for p in reversed(root.path_list()):
                 visitor.endGroup()
     else:
+        # New stats starting from root.
+        dump_group(Root.getInstance())
+
         # Legacy stats
         for stat in stats_list:
             stat.visit(visitor)
 
-        # New stats starting from root.
-        dump_group(Root.getInstance())
-
 lastDump = 0
 # List[SimObject].
 global_dump_roots = []