Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/34818 )
Change subject: base: Use M5_UNLIKELY with conditional DPRINTF family
functions.
......................................................................
base: Use M5_UNLIKELY with conditional DPRINTF family functions.
Most DPRINTFs will be skipped over most of the time, and when they
aren't they'll already have overhead from string handling, output to the
console and/or a file, etc, which will drown out the behavior of a
branch.
Change-Id: I5475d7b5add63b44f60c0a1d46b4b14e6bf30fd3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34818
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/base/trace.hh
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/base/trace.hh b/src/base/trace.hh
index 3d8752c..aafb9c8 100644
--- a/src/base/trace.hh
+++ b/src/base/trace.hh
@@ -182,14 +182,14 @@
#define DDUMP(x, data, count) do { \
using namespace Debug; \
- if (DTRACE(x)) \
+ if (M5_UNLIKELY(DTRACE(x))) \
Trace::getDebugLogger()->dump( \
curTick(), name(), data, count, #x); \
} while (0)
#define DPRINTF(x, ...) do { \
using namespace Debug; \
- if (DTRACE(x)) { \
+ if (M5_UNLIKELY(DTRACE(x))) { \
Trace::getDebugLogger()->dprintf_flag( \
curTick(), name(), #x, __VA_ARGS__); \
} \
@@ -197,7 +197,7 @@
#define DPRINTFS(x, s, ...) do { \
using namespace Debug; \
- if (DTRACE(x)) { \
+ if (M5_UNLIKELY(DTRACE(x))) { \
Trace::getDebugLogger()->dprintf_flag( \
curTick(), s->name(), #x, __VA_ARGS__); \
} \
@@ -205,7 +205,7 @@
#define DPRINTFR(x, ...) do { \
using namespace Debug; \
- if (DTRACE(x)) { \
+ if (M5_UNLIKELY(DTRACE(x))) { \
Trace::getDebugLogger()->dprintf_flag( \
(Tick)-1, std::string(), #x, __VA_ARGS__); \
} \
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/34818
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: I5475d7b5add63b44f60c0a1d46b4b14e6bf30fd3
Gerrit-Change-Number: 34818
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Anthony Gutierrez <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[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