Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/45006 )

Change subject: base: Simplify the definition of DTRACE.
......................................................................

base: Simplify the definition of DTRACE.

Instead of gating the behavior of DTRACE based on TRACING_ON in the
preprocessor, move it to C++. Beyond being a little simpler, this
ensures that the value of Debug::x is always valid (the proper header is
included, x is spelled correctly, etc) even if TRACING_ON is false.

Change-Id: Ie0085c0f8753ad5283ef1850d493706b977c21a8
---
M src/base/debug.hh
1 file changed, 1 insertion(+), 5 deletions(-)



diff --git a/src/base/debug.hh b/src/base/debug.hh
index 38d92f9..4b77e16 100644
--- a/src/base/debug.hh
+++ b/src/base/debug.hh
@@ -151,11 +151,7 @@
  * @ingroup api_trace
  * @{
  */
-#if TRACING_ON
-#   define DTRACE(x) (Debug::x)
-#else // !TRACING_ON
-#   define DTRACE(x) (false)
-#endif  // TRACING_ON
+#define DTRACE(x) (TRACING_ON && Debug::x)
 /** @} */ // end of api_trace

 #endif // __BASE_DEBUG_HH__

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45006
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: Ie0085c0f8753ad5283ef1850d493706b977c21a8
Gerrit-Change-Number: 45006
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

Reply via email to