misc: Changed gem5 version info for gem5 20.2 dev
[gem5.git] / src / base / trace.hh
index c3372e7090a29c248d05c88b55fbd6287d8d523e..aafb9c8e434f5b31028403d3c8dce0297d82f45e 100644 (file)
@@ -156,30 +156,40 @@ class Named
     const std::string &name() const { return _name; }
 };
 
-//
-// DPRINTF is a debugging trace facility that allows one to
-// selectively enable tracing statements.  To use DPRINTF, there must
-// be a function or functor called name() that returns a const
-// std::string & in the current scope.
-//
-// If you desire that the automatic printing not occur, use DPRINTFR
-// (R for raw)
-//
+/**
+ * DPRINTF is a debugging trace facility that allows one to
+ * selectively enable tracing statements.  To use DPRINTF, there must
+ * be a function or functor called name() that returns a const
+ * std::string & in the current scope.
+ *
+ * If you desire that the automatic printing not occur, use DPRINTFR
+ * (R for raw)
+ *
+ * \def DDUMP(x, data, count)
+ * \def DPRINTF(x, ...)
+ * \def DPRINTFS(x, s, ...)
+ * \def DPRINTFR(x, ...)
+ * \def DDUMPN(data, count)
+ * \def DPRINTFN(...)
+ * \def DPRINTFNR(...)
+ * \def DPRINTF_UNCONDITIONAL(x, ...)
+ *
+ * @ingroup api_trace
+ * @{
+ */
 
 #if TRACING_ON
 
-#define DTRACE(x) (Debug::x)
-
 #define DDUMP(x, data, count) do {               \
     using namespace Debug;                       \
-    if (DTRACE(x))                               \
+    if (M5_UNLIKELY(DTRACE(x)))                  \
         Trace::getDebugLogger()->dump(           \
             curTick(), name(), data, count, #x); \
 } while (0)
 
 #define DPRINTF(x, ...) do {                     \
     using namespace Debug;                       \
-    if (DTRACE(x)) {                             \
+    if (M5_UNLIKELY(DTRACE(x))) {                \
         Trace::getDebugLogger()->dprintf_flag(   \
             curTick(), name(), #x, __VA_ARGS__); \
     }                                            \
@@ -187,7 +197,7 @@ class Named
 
 #define DPRINTFS(x, s, ...) do {                        \
     using namespace Debug;                              \
-    if (DTRACE(x)) {                                    \
+    if (M5_UNLIKELY(DTRACE(x))) {                       \
         Trace::getDebugLogger()->dprintf_flag(          \
                 curTick(), s->name(), #x, __VA_ARGS__); \
     }                                                   \
@@ -195,7 +205,7 @@ class Named
 
 #define DPRINTFR(x, ...) do {                          \
     using namespace Debug;                             \
-    if (DTRACE(x)) {                                   \
+    if (M5_UNLIKELY(DTRACE(x))) {                      \
         Trace::getDebugLogger()->dprintf_flag(         \
             (Tick)-1, std::string(), #x, __VA_ARGS__); \
     }                                                  \
@@ -220,7 +230,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)
@@ -232,4 +241,6 @@ class Named
 
 #endif  // TRACING_ON
 
+/** @} */ // end of api_trace
+
 #endif // __BASE_TRACE_HH__