Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/29411 )

Change subject: base,sim: Move DTRACE into base/debug.hh.
......................................................................

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 <gabebl...@google.com>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
---
M src/base/debug.hh
M src/base/trace.hh
M src/sim/eventq_impl.hh
3 files changed, 7 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/base/debug.hh b/src/base/debug.hh
index 527af6a..7c9834c 100644
--- a/src/base/debug.hh
+++ b/src/base/debug.hh
@@ -137,4 +137,10 @@

 void dumpDebugFlags();

+#if TRACING_ON
+#   define DTRACE(x) (Debug::x)
+#else // !TRACING_ON
+#   define DTRACE(x) (false)
+#endif  // TRACING_ON
+
 #endif // __BASE_DEBUG_HH__
diff --git a/src/base/trace.hh b/src/base/trace.hh
index c3372e7..c3a499b 100644
--- a/src/base/trace.hh
+++ b/src/base/trace.hh
@@ -168,8 +168,6 @@

 #if TRACING_ON

-#define DTRACE(x) (Debug::x)
-
 #define DDUMP(x, data, count) do {               \
     using namespace Debug;                       \
     if (DTRACE(x))                               \
@@ -220,7 +218,6 @@

 #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)
diff --git a/src/sim/eventq_impl.hh b/src/sim/eventq_impl.hh
index 39bf00b..0e4f408 100644
--- a/src/sim/eventq_impl.hh
+++ b/src/sim/eventq_impl.hh
@@ -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

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29411
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: I0dac83295891630686c3a8038eb54138cf40ab44
Gerrit-Change-Number: 29411
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bradford Beckmann <brad.beckm...@amd.com>
Gerrit-Reviewer: Gabe Black <gabebl...@google.com>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to