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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45006
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
Gabe Black
2021-04-29 21:39:57 -07:00
parent 3e689021a2
commit 924fb60aad

View File

@@ -151,11 +151,7 @@ void dumpDebugFlags(std::ostream &os=std::cout);
* @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__