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__); \
} \
#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__); \
} \
#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__); \
} \
#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)
#endif // TRACING_ON
+/** @} */ // end of api_trace
+
#endif // __BASE_TRACE_HH__