Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33384 )

Change subject: mem-cache: Add stats for failed compressions
......................................................................

mem-cache: Add stats for failed compressions

Add statistics to keep track of the number of times compression
has failed to provide blocks whose compressed size passes the
size threshold.

Also, update the compressed data's size if compression fails.

Change-Id: If3479572bf114f07911238c602ffef3a90b6a931
Signed-off-by: Daniel R. Carvalho <oda...@yahoo.com.br>
---
M src/mem/cache/compressors/base.cc
M src/mem/cache/compressors/base.hh
2 files changed, 6 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/compressors/base.cc b/src/mem/cache/compressors/base.cc
index de29c69..5de6598 100644
--- a/src/mem/cache/compressors/base.cc
+++ b/src/mem/cache/compressors/base.cc
@@ -148,6 +148,7 @@
     if (comp_size_bits > sizeThreshold * CHAR_BIT) {
         comp_size_bits = blkSize * CHAR_BIT;
         comp_data->setSizeBits(comp_size_bits);
+        stats.failedCompressions++;
     }

     // Update stats
@@ -205,6 +206,8 @@
   : Stats::Group(&_compressor), compressor(_compressor),
     compressions(this, "compressions",
         "Total number of compressions"),
+    failedCompressions(this, "failed_compressions",
+        "Total number of failed compressions"),
     compressionSize(this, "compression_size",
         "Number of blocks that were compressed to this power of two size"),
     compressionSizeBits(this, "compression_size_bits",
diff --git a/src/mem/cache/compressors/base.hh b/src/mem/cache/compressors/base.hh
index 1008aae..2725f71 100644
--- a/src/mem/cache/compressors/base.hh
+++ b/src/mem/cache/compressors/base.hh
@@ -106,6 +106,9 @@
         /** Number of compressions performed. */
         Stats::Scalar compressions;

+        /** Number of failed compressions. */
+        Stats::Scalar failedCompressions;
+
/** Number of blocks that were compressed to this power of two size. */
         Stats::Vector compressionSize;


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/33384
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: If3479572bf114f07911238c602ffef3a90b6a931
Gerrit-Change-Number: 33384
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to