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

Change subject: sim: Stop using DPRINTF_UNCONDITIONAL in the event class.
......................................................................

sim: Stop using DPRINTF_UNCONDITIONAL in the event class.

Just because the current methods of the base class only call
Event::trace from within DTRACE(Event), that's no guarantee that future
methods will, that the call sites won't be changed so that they don't,
or any number of subclasses that may not even exist today will.

Instead, we should incur the very slight overhead of checking the
Debug::Event variable again to ensure expected behavior, and to avoid
unnecessary complexity for a very small optimization when we're already
enabled a high overhead behavior like tracing for all events in a
virtual function.

Change-Id: I1c360b2ba73ad73c0658e85e9122f1fef07f93ce
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44986
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Giacomo Travaglini <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/sim/eventq.cc
1 file changed, 1 insertion(+), 5 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Giacomo Travaglini: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc
index 3e99683..92863b1 100644
--- a/src/sim/eventq.cc
+++ b/src/sim/eventq.cc
@@ -376,16 +376,12 @@
 void
 Event::trace(const char *action)
 {
-    // This DPRINTF is unconditional because calls to this function
-    // are protected by an 'if (DTRACE(Event))' in the inlined Event
-    // methods.
-    //
     // This is just a default implementation for derived classes where
     // it's not worth doing anything special.  If you want to put a
     // more informative message in the trace, override this method on
     // the particular subclass where you have the information that
     // needs to be printed.
-    DPRINTF_UNCONDITIONAL(Event, "%s %s %s @ %d\n",
+    DPRINTF(Event, "%s %s %s @ %d\n",
             description(), instanceString(), action, when());
 }


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/44986
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: I1c360b2ba73ad73c0658e85e9122f1fef07f93ce
Gerrit-Change-Number: 44986
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[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

Reply via email to