summaryrefslogtreecommitdiff
path: root/src/python/m5
diff options
context:
space:
mode:
authorSascha Bischoff <sascha.bischoff@arm.com>2012-09-25 11:49:41 -0500
committerSascha Bischoff <sascha.bischoff@arm.com>2012-09-25 11:49:41 -0500
commit74ab69c7eafc2f0d187ce3ba7d6b9a59ba291b9f (patch)
treee5165b40b79f8cab3fbee6293b4a976f8ba44bc4 /src/python/m5
parentacbb7a2eed15258061e038254469197ae3831165 (diff)
downloadgem5-74ab69c7eafc2f0d187ce3ba7d6b9a59ba291b9f.tar.xz
Statistics: Add a function to configure periodic stats dumping
This patch adds a function, periodicStatDump(long long period), which will dump and reset the statistics every period. This function is designed to be called from the python configuration scripts. This allows the periodic stats dumping to be configured more easilly at run time. The period is currently specified as a long long as there are issues passing Tick into the C++ from the python as they have conflicting definitions. If the period is less than curTick, the first occurance occurs at curTick. If the period is set to 0, then the event is descheduled and the stats are not periodically dumped. Due to issues when resumung from a checkpoint, the StatDump event must be moved forward such that it occues AFTER the current tick. As the function is called from the python, the event is scheduled before the system resumes from the checkpoint. Therefore, the event is moved using the updateEvents() function. This is called from simulate.py once the system has resumed from the checkpoint. NOTE: It should be noted that this is a fairly temporary patch which re-adds the capability to extract temporal information from the communication monitors. It should not be used at the same time as anything that relies on dumping the statistics based on in simulation events i.e. a context switch.
Diffstat (limited to 'src/python/m5')
-rw-r--r--src/python/m5/simulate.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py
index e95136548..5fc00ad05 100644
--- a/src/python/m5/simulate.py
+++ b/src/python/m5/simulate.py
@@ -52,6 +52,7 @@ import SimObject
import ticks
import objects
from m5.util.dot_writer import do_dot
+from m5.internal.stats import updateEvents as updateStatEvents
from util import fatal
from util import attrdict
@@ -123,6 +124,10 @@ def instantiate(ckpt_dir=None):
else:
for obj in root.descendants(): obj.initState()
+ # Check to see if any of the stat events are in the past after resuming from
+ # a checkpoint, If so, this call will shift them to be at a valid time.
+ updateStatEvents()
+
# Reset to put the stats in a consistent state.
stats.reset()