arch-arm,arch-riscv,arch-x86: Add units to stats
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 20 Jan 2021 10:15:49 +0000 (02:15 -0800)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 10 Feb 2021 09:03:09 +0000 (09:03 +0000)
Change-Id: I6bf506c223207306d71511491e024546b209030f
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39416
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
src/arch/arm/table_walker.cc
src/arch/arm/tlb.cc
src/arch/riscv/tlb.cc
src/arch/x86/tlb.cc

index 7f19adb394223a4c38b10ef60462c21bc58cfe90..5ef41fbee7d4faed3ce60a850c87c1e271c3a4f0 100644 (file)
@@ -2317,25 +2317,31 @@ TableWalker::pageSizeNtoStatBin(uint8_t N)
 
 TableWalker::TableWalkerStats::TableWalkerStats(Stats::Group *parent)
     : Stats::Group(parent),
-    ADD_STAT(walks, "Table walker walks requested"),
-    ADD_STAT(walksShortDescriptor, "Table walker walks initiated with"
-        " short descriptors"),
-    ADD_STAT(walksLongDescriptor, "Table walker walks initiated with"
-        " long descriptors"),
-    ADD_STAT(walksShortTerminatedAtLevel, "Level at which table walker"
-        " walks with short descriptors terminate"),
-    ADD_STAT(walksLongTerminatedAtLevel, "Level at which table walker"
-        " walks with long descriptors terminate"),
-    ADD_STAT(squashedBefore, "Table walks squashed before starting"),
-    ADD_STAT(squashedAfter, "Table walks squashed after completion"),
-    ADD_STAT(walkWaitTime, "Table walker wait (enqueue to first request)"
-        " latency"),
-    ADD_STAT(walkServiceTime, "Table walker service (enqueue to completion)"
-        " latency"),
-    ADD_STAT(pendingWalks, "Table walker pending requests distribution"),
-    ADD_STAT(pageSizes, "Table walker page sizes translated"),
-    ADD_STAT(requestOrigin, "Table walker requests started/completed,"
-        " data/inst")
+    ADD_STAT(walks, UNIT_COUNT, "Table walker walks requested"),
+    ADD_STAT(walksShortDescriptor, UNIT_COUNT,
+             "Table walker walks initiated with short descriptors"),
+    ADD_STAT(walksLongDescriptor, UNIT_COUNT,
+             "Table walker walks initiated with long descriptors"),
+    ADD_STAT(walksShortTerminatedAtLevel, UNIT_COUNT,
+             "Level at which table walker walks with short descriptors "
+             "terminate"),
+    ADD_STAT(walksLongTerminatedAtLevel, UNIT_COUNT,
+             "Level at which table walker walks with long descriptors "
+             "terminate"),
+    ADD_STAT(squashedBefore, UNIT_COUNT,
+             "Table walks squashed before starting"),
+    ADD_STAT(squashedAfter, UNIT_COUNT,
+             "Table walks squashed after completion"),
+    ADD_STAT(walkWaitTime, UNIT_TICK,
+             "Table walker wait (enqueue to first request) latency"),
+    ADD_STAT(walkServiceTime, UNIT_TICK,
+             "Table walker service (enqueue to completion) latency"),
+    ADD_STAT(pendingWalks, UNIT_TICK,
+             "Table walker pending requests distribution"),
+    ADD_STAT(pageSizes, UNIT_COUNT,
+             "Table walker page sizes translated"),
+    ADD_STAT(requestOrigin, UNIT_COUNT,
+             "Table walker requests started/completed, data/inst")
 {
     walksShortDescriptor
         .flags(Stats::nozero);
index 6f16f6cf7d4c2694e3f5f99154e75a53d519d735..fd72d258b9e7519eff8722668b6978310e0120fb 100644 (file)
@@ -507,34 +507,43 @@ TLB::takeOverFrom(BaseTLB *_otlb)
 
 TLB::TlbStats::TlbStats(Stats::Group *parent)
   : Stats::Group(parent),
-    ADD_STAT(instHits,"ITB inst hits"),
-    ADD_STAT(instMisses, "ITB inst misses"),
-    ADD_STAT(readHits, "DTB read hits"),
-    ADD_STAT(readMisses, "DTB read misses"),
-    ADD_STAT(writeHits, "DTB write hits"),
-    ADD_STAT(writeMisses, "DTB write misses"),
-    ADD_STAT(inserts, "Number of times an entry is inserted into the TLB"),
-    ADD_STAT(flushTlb, "Number of times complete TLB was flushed"),
-    ADD_STAT(flushTlbMva, "Number of times TLB was flushed by MVA"),
-    ADD_STAT(flushTlbMvaAsid, "Number of times TLB was flushed by MVA & ASID"),
-    ADD_STAT(flushTlbAsid, "Number of times TLB was flushed by ASID"),
-    ADD_STAT(flushedEntries, "Number of entries that have been flushed"
-        " from TLB"),
-    ADD_STAT(alignFaults, "Number of TLB faults due to alignment"
-        " restrictions"),
-    ADD_STAT(prefetchFaults, "Number of TLB faults due to prefetch"),
-    ADD_STAT(domainFaults, "Number of TLB faults due to domain restrictions"),
-    ADD_STAT(permsFaults, "Number of TLB faults due to permissions"
-        " restrictions"),
-    ADD_STAT(readAccesses, "DTB read accesses", readHits + readMisses),
-    ADD_STAT(writeAccesses, "DTB write accesses", writeHits + writeMisses),
-    ADD_STAT(instAccesses, "ITB inst accesses", instHits + instMisses),
-    ADD_STAT(hits, "Total TLB (inst and data) hits",
-        readHits + writeHits + instHits),
-    ADD_STAT(misses, "Total TLB (inst and data) misses",
-        readMisses + writeMisses + instMisses),
-    ADD_STAT(accesses, "Total TLB (inst and data) accesses",
-        readAccesses + writeAccesses + instAccesses)
+    ADD_STAT(instHits, UNIT_COUNT, "ITB inst hits"),
+    ADD_STAT(instMisses, UNIT_COUNT, "ITB inst misses"),
+    ADD_STAT(readHits, UNIT_COUNT, "DTB read hits"),
+    ADD_STAT(readMisses, UNIT_COUNT,  "DTB read misses"),
+    ADD_STAT(writeHits, UNIT_COUNT, "DTB write hits"),
+    ADD_STAT(writeMisses, UNIT_COUNT, "DTB write misses"),
+    ADD_STAT(inserts, UNIT_COUNT,
+             "Number of times an entry is inserted into the TLB"),
+    ADD_STAT(flushTlb, UNIT_COUNT, "Number of times complete TLB was flushed"),
+    ADD_STAT(flushTlbMva, UNIT_COUNT,
+             "Number of times TLB was flushed by MVA"),
+    ADD_STAT(flushTlbMvaAsid, UNIT_COUNT,
+             "Number of times TLB was flushed by MVA & ASID"),
+    ADD_STAT(flushTlbAsid, UNIT_COUNT,
+             "Number of times TLB was flushed by ASID"),
+    ADD_STAT(flushedEntries, UNIT_COUNT,
+             "Number of entries that have been flushed from TLB"),
+    ADD_STAT(alignFaults, UNIT_COUNT,
+             "Number of TLB faults due to alignment restrictions"),
+    ADD_STAT(prefetchFaults, UNIT_COUNT,
+             "Number of TLB faults due to prefetch"),
+    ADD_STAT(domainFaults, UNIT_COUNT,
+             "Number of TLB faults due to domain restrictions"),
+    ADD_STAT(permsFaults, UNIT_COUNT,
+             "Number of TLB faults due to permissions restrictions"),
+    ADD_STAT(readAccesses, UNIT_COUNT, "DTB read accesses",
+             readHits + readMisses),
+    ADD_STAT(writeAccesses, UNIT_COUNT, "DTB write accesses",
+             writeHits + writeMisses),
+    ADD_STAT(instAccesses, UNIT_COUNT, "ITB inst accesses",
+             instHits + instMisses),
+    ADD_STAT(hits, UNIT_COUNT, "Total TLB (inst and data) hits",
+             readHits + writeHits + instHits),
+    ADD_STAT(misses, UNIT_COUNT, "Total TLB (inst and data) misses",
+             readMisses + writeMisses + instMisses),
+    ADD_STAT(accesses, UNIT_COUNT, "Total TLB (inst and data) accesses",
+             readAccesses + writeAccesses + instAccesses)
 {
 }
 
index 491f15feb7214be51fcb7515447bfd1b10fb5bf0..84eb6e2bff51587bae246513f85c39c7e4d332d0 100644 (file)
@@ -498,16 +498,17 @@ TLB::unserialize(CheckpointIn &cp)
 
 TLB::TlbStats::TlbStats(Stats::Group *parent)
   : Stats::Group(parent),
-    ADD_STAT(read_hits, "read hits"),
-    ADD_STAT(read_misses, "read misses"),
-    ADD_STAT(read_accesses, "read accesses"),
-    ADD_STAT(write_hits, "write hits"),
-    ADD_STAT(write_misses, "write misses"),
-    ADD_STAT(write_accesses, "write accesses"),
-    ADD_STAT(hits, "Total TLB (read and write) hits", read_hits + write_hits),
-    ADD_STAT(misses, "Total TLB (read and write) misses",
-        read_misses + write_misses),
-    ADD_STAT(accesses, "Total TLB (read and write) accesses",
-        read_accesses + write_accesses)
+    ADD_STAT(read_hits, UNIT_COUNT, "read hits"),
+    ADD_STAT(read_misses, UNIT_COUNT, "read misses"),
+    ADD_STAT(read_accesses, UNIT_COUNT, "read accesses"),
+    ADD_STAT(write_hits, UNIT_COUNT, "write hits"),
+    ADD_STAT(write_misses, UNIT_COUNT, "write misses"),
+    ADD_STAT(write_accesses, UNIT_COUNT, "write accesses"),
+    ADD_STAT(hits, UNIT_COUNT, "Total TLB (read and write) hits",
+             read_hits + write_hits),
+    ADD_STAT(misses, UNIT_COUNT, "Total TLB (read and write) misses",
+             read_misses + write_misses),
+    ADD_STAT(accesses, UNIT_COUNT, "Total TLB (read and write) accesses",
+             read_accesses + write_accesses)
 {
 }
index 045015f92247a9e69cf18dd77e1d4140b8204f4d..6d6b14e8c1b2ce1b151b1150151b29b87a784b0f 100644 (file)
@@ -520,10 +520,10 @@ TLB::getWalker()
 
 TLB::TlbStats::TlbStats(Stats::Group *parent)
   : Stats::Group(parent),
-    ADD_STAT(rdAccesses, "TLB accesses on read requests"),
-    ADD_STAT(wrAccesses, "TLB accesses on write requests"),
-    ADD_STAT(rdMisses, "TLB misses on read requests"),
-    ADD_STAT(wrMisses, "TLB misses on write requests")
+    ADD_STAT(rdAccesses, UNIT_COUNT, "TLB accesses on read requests"),
+    ADD_STAT(wrAccesses, UNIT_COUNT, "TLB accesses on write requests"),
+    ADD_STAT(rdMisses, UNIT_COUNT, "TLB misses on read requests"),
+    ADD_STAT(wrMisses, UNIT_COUNT, "TLB misses on write requests")
 {
 }