Go to the documentation of this file.
32 #ifndef __BASE_TRACE_HH__
33 #define __BASE_TRACE_HH__
50 const std::string &
name();
73 if (ignore_match && activate_match)
74 panic(
"%s in both ignore and activate.\n",
name);
84 template <
typename ...Args>
92 template <
typename ...Args>
94 const std::string &flag,
95 const char *fmt,
const Args &...args)
99 std::ostringstream line;
106 const void *
d,
int len,
const std::string &flag);
110 const std::string &flag,
const std::string &message) = 0;
146 const std::string &flag,
const std::string &message)
override;
204 #define DDUMP(x, data, count) do { \
205 if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) \
206 ::gem5::trace::getDebugLogger()->dump( \
207 ::gem5::curTick(), name(), data, count, #x); \
210 #define DPRINTF(x, ...) do { \
211 if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
212 ::gem5::trace::getDebugLogger()->dprintf_flag( \
213 ::gem5::curTick(), name(), #x, __VA_ARGS__); \
217 #define DPRINTFS(x, s, ...) do { \
218 if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
219 ::gem5::trace::getDebugLogger()->dprintf_flag( \
220 ::gem5::curTick(), (s)->name(), #x, __VA_ARGS__); \
224 #define DPRINTFR(x, ...) do { \
225 if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
226 ::gem5::trace::getDebugLogger()->dprintf_flag( \
227 (::gem5::Tick)-1, std::string(), #x, __VA_ARGS__); \
231 #define DPRINTFV(x, ...) do { \
232 if (GEM5_UNLIKELY(TRACING_ON && (x))) { \
233 ::gem5::trace::getDebugLogger()->dprintf_flag( \
234 ::gem5::curTick(), name(), x.name(), __VA_ARGS__); \
238 #define DPRINTFN(...) do { \
240 ::gem5::trace::getDebugLogger()->dprintf( \
241 ::gem5::curTick(), name(), __VA_ARGS__); \
245 #define DPRINTFNR(...) do { \
247 ::gem5::trace::getDebugLogger()->dprintf( \
248 (::gem5::Tick)-1, "", __VA_ARGS__); \
252 #define DPRINTF_UNCONDITIONAL(x, ...) \
253 GEM5_DEPRECATED_MACRO_STMT(DPRINTF_UNCONDITIONAL, \
256 ::gem5::trace::getDebugLogger()->dprintf_flag( \
257 ::gem5::curTick(), name(), #x, __VA_ARGS__); \
260 "Use DPRINTFN or DPRINTF with a debug flag instead.")
266 #endif // __BASE_TRACE_HH__
ObjectMatch activate
Name match for objects to activate log.
ObjectMatch contains a vector of expressions.
OstreamLogger(std::ostream &stream_)
bool match(const std::string &name) const
virtual void logMessage(Tick when, const std::string &name, const std::string &flag, const std::string &message)=0
Log formatted message.
void addActivate(const ObjectMatch &activate_)
Add objects to activate.
void setIgnore(ObjectMatch &ignore_)
Set objects to ignore.
void ccprintf(cp::Print &print)
void logMessage(Tick when, const std::string &name, const std::string &flag, const std::string &message) override
Log formatted message.
const std::string & operator()() const
bool isEnabled(const std::string &name) const
uint64_t Tick
Tick count type.
void dprintf_flag(Tick when, const std::string &name, const std::string &flag, const char *fmt, const Args &...args)
Log a single message with a flag prefix.
Logging wrapper for ostreams with the format: <when>: <name>: <message-body>
void dprintf(Tick when, const std::string &name, const char *fmt, const Args &...args)
Log a single message.
Logger * getDebugLogger()
Get the current global debug logger.
void setActivate(ObjectMatch &activate_)
Set objects to activate.
std::ostream & output()
Get the ostream from the current global logger.
void dump(Tick when, const std::string &name, const void *d, int len, const std::string &flag)
Dump a block of data of length len.
void setDebugLogger(Logger *logger)
Delete the current global logger and assign a new one.
ObjectMatch ignore
Name match for objects to ignore.
std::ostream & getOstream() override
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messa...
void addIgnore(const ObjectMatch &ignore_)
Add objects to ignore.
const std::string & name()
Debug logging base class.
virtual std::ostream & getOstream()=0
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messa...
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
void enable()
Enable/disable debug logging.
void add(const ObjectMatch &other)
StringWrap(const std::string &s)
#define panic(...)
This implements a cprintf based panic() function.
Generated on Sun Jul 30 2023 01:56:51 for gem5 by doxygen 1.8.17