Daniel Carvalho has submitted this change. ( 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 <[email protected]>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33384
Reviewed-by: Nikos Nikoleris <[email protected]>
Maintainer: Nikos Nikoleris <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/mem/cache/compressors/base.cc
M src/mem/cache/compressors/base.hh
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Nikos Nikoleris: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/mem/cache/compressors/base.cc b/src/mem/cache/compressors/base.cc
index 788a76f..5b96e97 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
@@ -209,6 +210,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: 3
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to