Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/52405 )
Change subject: mem-cache: Don't generate debug output unless you're going
to use it.
......................................................................
mem-cache: Don't generate debug output unless you're going to use it.
The BaseCache::handleFill function would generate an "old_state" string
unconditionally, just in case it would need to print it out later on in
the function if the Cache debug variable was set. This is very wasteful.
We should only generate that string if we are actually going to use it
later on.
Change-Id: I4a570d1cd2814e5a089eac1233dedd1801d68975
---
M src/mem/cache/base.cc
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index fa9257c..4007a4f 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -1439,7 +1439,7 @@
Addr addr = pkt->getAddr();
bool is_secure = pkt->isSecure();
const bool has_old_data = blk && blk->isValid();
- const std::string old_state = blk ? blk->print() : "";
+ const std::string old_state = (debug::Cache && blk) ?
blk->print() : "";
// When handling a fill, we should have no writes to this line.
assert(addr == pkt->getBlockAddr(blkSize));
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52405
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: I4a570d1cd2814e5a089eac1233dedd1801d68975
Gerrit-Change-Number: 52405
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s