Go to the documentation of this file.
32 #ifndef __BASE_TRACE_HH__
33 #define __BASE_TRACE_HH__
55 template <
typename ...Args>
63 template <
typename ...Args>
65 const std::string &flag,
66 const char *fmt,
const Args &...args)
70 std::ostringstream line;
77 const void *
d,
int len,
const std::string &flag);
81 const std::string &flag,
const std::string &message) = 0;
111 const std::string &flag,
const std::string &message)
override;
143 const std::string &
name();
183 #define DDUMP(x, data, count) do { \
184 using namespace Debug; \
186 Trace::getDebugLogger()->dump( \
187 curTick(), name(), data, count, #x); \
190 #define DPRINTF(x, ...) do { \
191 using namespace Debug; \
193 Trace::getDebugLogger()->dprintf_flag( \
194 curTick(), name(), #x, __VA_ARGS__); \
198 #define DPRINTFS(x, s, ...) do { \
199 using namespace Debug; \
201 Trace::getDebugLogger()->dprintf_flag( \
202 curTick(), s->name(), #x, __VA_ARGS__); \
206 #define DPRINTFR(x, ...) do { \
207 using namespace Debug; \
209 Trace::getDebugLogger()->dprintf_flag( \
210 (Tick)-1, std::string(), #x, __VA_ARGS__); \
214 #define DDUMPN(data, count) do { \
215 Trace::getDebugLogger()->dump(curTick(), name(), data, count); \
218 #define DPRINTFN(...) do { \
219 Trace::getDebugLogger()->dprintf(curTick(), name(), __VA_ARGS__); \
222 #define DPRINTFNR(...) do { \
223 Trace::getDebugLogger()->dprintf((Tick)-1, std::string(), __VA_ARGS__); \
226 #define DPRINTF_UNCONDITIONAL(x, ...) do { \
227 Trace::getDebugLogger()->dprintf_flag( \
228 curTick(), name(), #x, __VA_ARGS__); \
233 #define DDUMP(x, data, count) do {} while (0)
234 #define DPRINTF(x, ...) do {} while (0)
235 #define DPRINTFS(x, ...) do {} while (0)
236 #define DPRINTFR(...) do {} while (0)
237 #define DDUMPN(data, count) do {} while (0)
238 #define DPRINTFN(...) do {} while (0)
239 #define DPRINTFNR(...) do {} while (0)
240 #define DPRINTF_UNCONDITIONAL(x, ...) do {} while (0)
246 #endif // __BASE_TRACE_HH__
bool match(const std::string &name) const
uint64_t Tick
Tick count type.
Logger * getDebugLogger()
Get the current global debug logger.
virtual std::ostream & getOstream()=0
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messa...
const std::string & operator()() const
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.
void setIgnore(ObjectMatch &ignore_)
Set objects to ignore.
void setDebugLogger(Logger *logger)
Delete the current global logger and assign a new one.
StringWrap(const std::string &s)
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 enable()
Enable/disable debug logging.
Debug logging base class.
void logMessage(Tick when, const std::string &name, const std::string &flag, const std::string &message) override
Log formatted message.
Logging wrapper for ostreams with the format: <when>: <name>: <message-body>
virtual void logMessage(Tick when, const std::string &name, const std::string &flag, const std::string &message)=0
Log formatted message.
std::ostream & getOstream() override
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messa...
std::ostream & output()
Get the ostream from the current global logger.
void addIgnore(const ObjectMatch &ignore_)
Add objects to ignore.
Named(const std::string &name_)
ObjectMatch ignore
Name match for objects to ignore.
void ccprintf(cp::Print &print)
void add(const ObjectMatch &other)
void dprintf(Tick when, const std::string &name, const char *fmt, const Args &...args)
Log a single message.
const std::string & name()
const std::string & name() const
OstreamLogger(std::ostream &stream_)
ObjectMatch contains a vector of expressions.
Generated on Wed Sep 30 2020 14:02:08 for gem5 by doxygen 1.8.17