summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/System.hh
diff options
context:
space:
mode:
authorHamid Reza Khaleghzadeh ext:(%2C%20Lluc%20Alvarez%20%3Clluc.alvarez%40bsc.es%3E%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) <khaleghzadeh@gmail.com>2012-11-02 12:18:25 -0500
committerHamid Reza Khaleghzadeh ext:(%2C%20Lluc%20Alvarez%20%3Clluc.alvarez%40bsc.es%3E%2C%20Nilay%20Vaish%20%3Cnilay%40cs.wisc.edu%3E) <khaleghzadeh@gmail.com>2012-11-02 12:18:25 -0500
commit8cd475d58ebc144fdbdc34e710302eb3290bdd9b (patch)
treea34de336ea9a92c1899c11adc7fb57115e88dd73 /src/mem/ruby/system/System.hh
parentce5766c409ca3e27e62a300b89511b9d0fcd6c18 (diff)
downloadgem5-8cd475d58ebc144fdbdc34e710302eb3290bdd9b.tar.xz
ruby: reset and dump stats along with reset of the system
This patch adds support to ruby so that the statistics maintained by ruby are reset/dumped when the statistics for the rest of the system are reset/dumped. For resetting the statistics, ruby now provides the resetStats() function that a sim object can provide. As a consequence, the clearStats() function has been removed from RubySystem. For dumping stats, Ruby now adds a callback event to the dumpStatsQueue. The exit callback that ruby used to add earlier is being removed. Created by: Hamid Reza Khaleghzadeh. Improved by: Lluc Alvarez, Nilay Vaish Committed by: Nilay Vaish
Diffstat (limited to 'src/mem/ruby/system/System.hh')
-rw-r--r--src/mem/ruby/system/System.hh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh
index 245fa677e..24ec02111 100644
--- a/src/mem/ruby/system/System.hh
+++ b/src/mem/ruby/system/System.hh
@@ -36,6 +36,7 @@
#define __MEM_RUBY_SYSTEM_SYSTEM_HH__
#include "base/callback.hh"
+#include "base/output.hh"
#include "mem/packet.hh"
#include "mem/ruby/common/Global.hh"
#include "mem/ruby/recorder/CacheRecorder.hh"
@@ -103,7 +104,7 @@ class RubySystem : public ClockedObject
}
void printStats(std::ostream& out);
- void clearStats() const;
+ void resetStats();
uint64 getInstructionCount(int thread) { return 1; }
@@ -172,18 +173,19 @@ operator<<(std::ostream& out, const RubySystem& obj)
return out;
}
-class RubyExitCallback : public Callback
+class RubyDumpStatsCallback : public Callback
{
private:
- std::string stats_filename;
+ std::ostream *os;
RubySystem *ruby_system;
public:
- virtual ~RubyExitCallback() {}
+ virtual ~RubyDumpStatsCallback() {}
- RubyExitCallback(const std::string& _stats_filename, RubySystem *system)
+ RubyDumpStatsCallback(const std::string& _stats_filename,
+ RubySystem *system)
{
- stats_filename = _stats_filename;
+ os = simout.create(_stats_filename);
ruby_system = system;
}