summaryrefslogtreecommitdiff
path: root/src/mem/ruby/system/SparseMemory.cc
diff options
context:
space:
mode:
authorNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:28 -0500
committerNilay Vaish <nilay@cs.wisc.edu>2013-09-06 16:21:28 -0500
commitc0a8ad0a35cc273f494c9460277dcb13268baccc (patch)
treee9b26b72372b96d8b6dd5e92829f07ab11383b95 /src/mem/ruby/system/SparseMemory.cc
parent53cf77cf18fa44ed60ad586fb9add661853b205a (diff)
downloadgem5-c0a8ad0a35cc273f494c9460277dcb13268baccc.tar.xz
ruby: converts sparse memory stats to gem5 style
Diffstat (limited to 'src/mem/ruby/system/SparseMemory.cc')
-rw-r--r--src/mem/ruby/system/SparseMemory.cc42
1 files changed, 15 insertions, 27 deletions
diff --git a/src/mem/ruby/system/SparseMemory.cc b/src/mem/ruby/system/SparseMemory.cc
index db8d494f8..a16e553a3 100644
--- a/src/mem/ruby/system/SparseMemory.cc
+++ b/src/mem/ruby/system/SparseMemory.cc
@@ -57,15 +57,6 @@ SparseMemory::SparseMemory(int number_of_levels)
m_number_of_bits_per_level[level] = even_level_bits;
}
m_map_head = new SparseMapType;
-
- m_total_adds = 0;
- m_total_removes = 0;
- m_adds_per_level = new uint64_t[m_number_of_levels];
- m_removes_per_level = new uint64_t[m_number_of_levels];
- for (int level = 0; level < m_number_of_levels; level++) {
- m_adds_per_level[level] = 0;
- m_removes_per_level[level] = 0;
- }
}
SparseMemory::~SparseMemory()
@@ -73,8 +64,6 @@ SparseMemory::~SparseMemory()
recursivelyRemoveTables(m_map_head, 0);
delete m_map_head;
delete [] m_number_of_bits_per_level;
- delete [] m_adds_per_level;
- delete [] m_removes_per_level;
}
// Recursively search table hierarchy for the lowest level table.
@@ -409,21 +398,20 @@ SparseMemory::recordBlocks(int cntrl_id, CacheRecorder* tr) const
}
void
-SparseMemory::print(ostream& out) const
+SparseMemory::regStats(const string &name)
{
-}
-
-void
-SparseMemory::printStats(ostream& out) const
-{
- out << "total_adds: " << m_total_adds << " [";
- for (int level = 0; level < m_number_of_levels; level++) {
- out << m_adds_per_level[level] << " ";
- }
- out << "]" << endl;
- out << "total_removes: " << m_total_removes << " [";
- for (int level = 0; level < m_number_of_levels; level++) {
- out << m_removes_per_level[level] << " ";
- }
- out << "]" << endl;
+ m_total_adds.name(name + ".total_adds");
+
+ m_adds_per_level
+ .init(m_number_of_levels)
+ .name(name + ".adds_per_level")
+ .flags(Stats::pdf | Stats::total)
+ ;
+
+ m_total_removes.name(name + ".total_removes");
+ m_removes_per_level
+ .init(m_number_of_levels)
+ .name(name + ".removes_per_level")
+ .flags(Stats::pdf | Stats::total)
+ ;
}