learning-gem5: Add units to stats
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 20 Jan 2021 10:17:30 +0000 (02:17 -0800)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Wed, 10 Feb 2021 09:03:09 +0000 (09:03 +0000)
Change-Id: Iaff6c19b0b87250d15f5afb0763680fafe782d52
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39417
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

src/learning_gem5/part2/simple_cache.cc

index 661cae56f966b0d81a2901f7b78a9a7b0a51e051..788291fbbd71035313f083993a621ea1aa356e17 100644 (file)
@@ -423,11 +423,12 @@ SimpleCache::sendRangeChange() const
 
 SimpleCache::SimpleCacheStats::SimpleCacheStats(Stats::Group *parent)
       : Stats::Group(parent),
-      ADD_STAT(hits, "Number of hits"),
-      ADD_STAT(misses, "Number of misses"),
-      ADD_STAT(missLatency, "Ticks for misses to the cache"),
-      ADD_STAT(hitRatio, "The ratio of hits to the total"
-                 "accesses to the cache", hits / (hits + misses))
+      ADD_STAT(hits, UNIT_COUNT, "Number of hits"),
+      ADD_STAT(misses, UNIT_COUNT, "Number of misses"),
+      ADD_STAT(missLatency, UNIT_TICK, "Ticks for misses to the cache"),
+      ADD_STAT(hitRatio, UNIT_RATIO,
+               "The ratio of hits to the total accesses to the cache",
+               hits / (hits + misses))
 {
     missLatency.init(16); // number of buckets
 }