From 02881a7bf3e5a5920d258d13ed0aed282f252f07 Mon Sep 17 00:00:00 2001 From: Curtis Dunham Date: Wed, 30 Sep 2015 15:21:55 -0500 Subject: base: remove Trace::enabled flag The DTRACE() macro tests both Trace::enabled and the specific flag. This change uses the same administrative interface for enabling/disabling tracing, but masks the SimpleFlags settings directly. This eliminates a load for every DTRACE() test, e.g. DPRINTF. --- src/base/trace.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/base/trace.hh') diff --git a/src/base/trace.hh b/src/base/trace.hh index 70e85bf35..2b1d03eff 100644 --- a/src/base/trace.hh +++ b/src/base/trace.hh @@ -116,8 +116,9 @@ std::ostream &output(); /** Delete the current global logger and assign a new one */ void setDebugLogger(Logger *logger); -/** Enable debug logging */ -extern bool enabled; +/** Enable/disable debug logging */ +void enable(); +void disable(); } // namespace Trace @@ -160,7 +161,7 @@ class Named #if TRACING_ON -#define DTRACE(x) ((Debug::x) && Trace::enabled) +#define DTRACE(x) (Debug::x) #define DDUMP(x, data, count) do { \ using namespace Debug; \ -- cgit v1.2.3