summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2007-03-05 20:14:00 -0800
committerNathan Binkert <binkertn@umich.edu>2007-03-05 20:14:00 -0800
commitf800fddcea850822efee031b9b904280639da4c6 (patch)
tree49aa44340b58515ede869eb59cdc1021eb4163ad /src
parentf776ec84c1431c89b33364a559af76360532a0e3 (diff)
downloadgem5-f800fddcea850822efee031b9b904280639da4c6.tar.xz
Python atexit handlers are called in reverse order.
Fix things so the stats dump happens last. --HG-- extra : convert_revision : ea842dbcbb77dd1c715c4e5b57d2470e558c4265
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py
index 1c4a79020..30ebcfe7d 100644
--- a/src/python/m5/__init__.py
+++ b/src/python/m5/__init__.py
@@ -138,9 +138,11 @@ def simulate(*args, **kwargs):
def curTick():
return internal.event.cvar.curTick
+# Python exit handlers happen in reverse order. We want to dump stats last.
+atexit.register(internal.stats.dump)
+
# register our C++ exit callback function with Python
atexit.register(internal.core.doExitCleanup)
-atexit.register(internal.stats.dump)
# This loops until all objects have been fully drained.
def doDrain(root):