summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
Diffstat (limited to 'sim')
-rw-r--r--sim/sim_object.cc9
-rw-r--r--sim/sim_object.hh4
2 files changed, 13 insertions, 0 deletions
diff --git a/sim/sim_object.cc b/sim/sim_object.cc
index cab629f8d..39219b500 100644
--- a/sim/sim_object.cc
+++ b/sim/sim_object.cc
@@ -32,6 +32,7 @@
#include "base/inifile.hh"
#include "base/misc.hh"
#include "base/trace.hh"
+#include "base/stats/events.hh"
#include "sim/configfile.hh"
#include "sim/host.hh"
#include "sim/sim_object.hh"
@@ -58,6 +59,7 @@ SimObject::SimObjectList SimObject::simObjectList;
SimObject::SimObject(const string &_name)
: objName(_name)
{
+ doRecordEvent = !Stats::ignoreEvent(_name);
simObjectList.push_back(this);
}
@@ -170,4 +172,11 @@ SimObject::serializeAll(ostream &os)
}
}
+void
+SimObject::recordEvent(const std::string &stat)
+{
+ if (doRecordEvent)
+ Stats::recordEvent(stat);
+}
+
DEFINE_SIM_OBJECT_CLASS_NAME("SimObject", SimObject)
diff --git a/sim/sim_object.hh b/sim/sim_object.hh
index 1a9ed363d..770cd558e 100644
--- a/sim/sim_object.hh
+++ b/sim/sim_object.hh
@@ -82,6 +82,10 @@ class SimObject : public Serializable
// static: call nameOut() & serialize() on all SimObjects
static void serializeAll(std::ostream &);
+
+ public:
+ bool doRecordEvent;
+ void recordEvent(const std::string &stat);
};
#endif // __SIM_OBJECT_HH__