base,sim: Move DTRACE into base/debug.hh.
All other considerations aside, DTRACE probably fits best in trace.hh where it is now, but unfortunately that creates an awkward dependence between that file and eventq.hh and eventq_impl.hh. DTRACE only depends on flags in the Debug namespace and a universal macro TRACING_ON, so even though it won't be alongside the things it's most logically associated with, it will be alongside all of its dependencies. An alternative would be to re-implement DTRACE in eventq_impl.hh which wouldn't be too big of a problem because it's so simple, but it's cleaner and less error prone to still keep a single definition. Because base/trace.hh includes base/debug.hh, any consumers expecting to find DTRACE in base/trace.hh will still get that definition, even though it's no longer direct. Change-Id: I0dac83295891630686c3a8038eb54138cf40ab44 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29411 Maintainer: Gabe Black <gabeblack@google.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
This commit is contained in:
@@ -137,4 +137,10 @@ void clearDebugFlag(const char *string);
|
||||
|
||||
void dumpDebugFlags();
|
||||
|
||||
#if TRACING_ON
|
||||
# define DTRACE(x) (Debug::x)
|
||||
#else // !TRACING_ON
|
||||
# define DTRACE(x) (false)
|
||||
#endif // TRACING_ON
|
||||
|
||||
#endif // __BASE_DEBUG_HH__
|
||||
|
||||
@@ -168,8 +168,6 @@ class Named
|
||||
|
||||
#if TRACING_ON
|
||||
|
||||
#define DTRACE(x) (Debug::x)
|
||||
|
||||
#define DDUMP(x, data, count) do { \
|
||||
using namespace Debug; \
|
||||
if (DTRACE(x)) \
|
||||
@@ -220,7 +218,6 @@ class Named
|
||||
|
||||
#else // !TRACING_ON
|
||||
|
||||
#define DTRACE(x) (false)
|
||||
#define DDUMP(x, data, count) do {} while (0)
|
||||
#define DPRINTF(x, ...) do {} while (0)
|
||||
#define DPRINTFS(x, ...) do {} while (0)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#ifndef __SIM_EVENTQ_IMPL_HH__
|
||||
#define __SIM_EVENTQ_IMPL_HH__
|
||||
|
||||
#include "base/trace.hh"
|
||||
#include "base/debug.hh"
|
||||
#include "sim/eventq.hh"
|
||||
|
||||
inline void
|
||||
|
||||
Reference in New Issue
Block a user