summaryrefslogtreecommitdiff
path: root/src/python
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:26 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:26 -0500
commit413ba1fdaf666118c9a340d0c23c466f4b7d7fee (patch)
tree518724709eb3383ad66ea362a4ade55ccd294887 /src/python
parentf6895e8bd46a1533c607fe528a2da68b64e722dc (diff)
downloadgem5-413ba1fdaf666118c9a340d0c23c466f4b7d7fee.tar.xz
stats: track if the stats have been enabled and prevent requesting master id
Track the point in the initialization where statistics have been registered. After this point registering new masterIds can no longer work as some SimObjects may have sized stats vectors based on the previous value. If someone tries to register a masterId after this point the simulator executes fatal().
Diffstat (limited to 'src/python')
-rw-r--r--src/python/m5/stats/__init__.py2
-rw-r--r--src/python/swig/stats.i2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py
index 9b5af84fb..1d7e3bc5d 100644
--- a/src/python/m5/stats/__init__.py
+++ b/src/python/m5/stats/__init__.py
@@ -82,6 +82,8 @@ def enable():
stats_dict[stat.name] = stat
stat.enable()
+ internal.stats.enable();
+
def prepare():
'''Prepare all stats for data access. This must be done before
dumping and serialization.'''
diff --git a/src/python/swig/stats.i b/src/python/swig/stats.i
index 87810d305..14a6966b1 100644
--- a/src/python/swig/stats.i
+++ b/src/python/swig/stats.i
@@ -146,6 +146,8 @@ void schedStatEvent(bool dump, bool reset,
Tick when = curTick(), Tick repeat = 0);
void processResetQueue();
+void enable();
+bool enabled();
std::list<Info *> &statsList();