mem: Adding verbose debug output in the memory system
[gem5.git] / src / mem / cache / tags / base.cc
index 8c6c145ca46188ace1cdafb67f8b2b670c902640..0cabce860890a6160c702c409c37703a3fb34405 100644 (file)
  * Definitions of BaseTags.
  */
 
+#include "cpu/smt.hh" //maxThreadsPerCPU
 #include "mem/cache/tags/base.hh"
-
 #include "mem/cache/base.hh"
-#include "cpu/smt.hh" //maxThreadsPerCPU
 #include "sim/sim_exit.hh"
 
 using namespace std;
@@ -88,17 +87,23 @@ BaseTags::regStats(const string &name)
         ;
 
     occupancies
-        .init(cache->numCpus())
+        .init(cache->system->maxMasters())
         .name(name + ".occ_blocks")
-        .desc("Average occupied blocks per context")
+        .desc("Average occupied blocks per requestor")
         .flags(nozero | nonan)
         ;
+    for (int i = 0; i < cache->system->maxMasters(); i++) {
+        occupancies.subname(i, cache->system->getMasterName(i));
+    }
 
     avgOccs
-        .name(name + ".occ_%")
+        .name(name + ".occ_percent")
         .desc("Average percentage of cache occupancy")
-        .flags(nozero)
+        .flags(nozero | total)
         ;
+    for (int i = 0; i < cache->system->maxMasters(); i++) {
+        avgOccs.subname(i, cache->system->getMasterName(i));
+    }
 
     avgOccs = occupancies / Stats::constant(numBlocks);