summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/python/m5/stats/__init__.py20
-rw-r--r--src/python/swig/stats.i16
2 files changed, 4 insertions, 32 deletions
diff --git a/src/python/m5/stats/__init__.py b/src/python/m5/stats/__init__.py
index 4defaf5c1..f3d394311 100644
--- a/src/python/m5/stats/__init__.py
+++ b/src/python/m5/stats/__init__.py
@@ -49,25 +49,13 @@ def initSimStats():
names = []
stats_dict = {}
stats_list = []
-raw_stats_list = []
def enable():
'''Enable the statistics package. Before the statistics package is
enabled, all statistics must be created and initialized and once
the package is enabled, no more statistics can be created.'''
- __dynamic_cast = []
- for k, v in internal.stats.__dict__.iteritems():
- if k.startswith('dynamic_'):
- __dynamic_cast.append(v)
-
- for stat in internal.stats.statsList():
- for cast in __dynamic_cast:
- val = cast(stat)
- if val is not None:
- stats_list.append(val)
- raw_stats_list.append(val)
- break
- else:
- fatal("unknown stat type %s", stat)
+
+ global stats_list
+ stats_list = list(internal.stats.statsList())
for stat in stats_list:
if not stat.check() or not stat.baseCheck():
@@ -116,7 +104,7 @@ def dump():
if output.valid():
output.begin()
for stat in stats_list:
- output.visit(stat)
+ stat.visit(output)
output.end()
def reset():
diff --git a/src/python/swig/stats.i b/src/python/swig/stats.i
index 41115445c..b9da5a5ad 100644
--- a/src/python/swig/stats.i
+++ b/src/python/swig/stats.i
@@ -46,12 +46,6 @@
#include "sim/stat_register.hh"
namespace Stats {
-template <class T>
-inline T
-cast_info(Info *info)
-{
- return dynamic_cast<T>(info);
-}
inline FlagsType
Stats_Info_flags_get(Info *info)
@@ -124,16 +118,6 @@ namespace std {
namespace Stats {
-template <class T> T cast_info(Info *info);
-
-%template(dynamic_ScalarInfo) cast_info<ScalarInfo *>;
-%template(dynamic_VectorInfo) cast_info<VectorInfo *>;
-%template(dynamic_DistInfo) cast_info<DistInfo *>;
-%template(dynamic_VectorDistInfo) cast_info<VectorDistInfo *>;
-%template(dynamic_Vector2dInfo) cast_info<Vector2dInfo *>;
-%template(dynamic_FormulaInfo) cast_info<FormulaInfo *>;
-%template(dynamic_SparseHistInfo) cast_info<SparseHistInfo *>;
-
void initSimStats();
Output *initText(const std::string &filename, bool desc);