gem5
v20.1.0.0
|
Debug logging base class. More...
#include <trace.hh>
Public Member Functions | |
template<typename ... Args> | |
void | dprintf (Tick when, const std::string &name, const char *fmt, const Args &...args) |
Log a single message. More... | |
template<typename ... Args> | |
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. More... | |
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. More... | |
virtual void | logMessage (Tick when, const std::string &name, const std::string &flag, const std::string &message)=0 |
Log formatted message. More... | |
virtual std::ostream & | getOstream ()=0 |
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages. More... | |
void | setIgnore (ObjectMatch &ignore_) |
Set objects to ignore. More... | |
void | addIgnore (const ObjectMatch &ignore_) |
Add objects to ignore. More... | |
virtual | ~Logger () |
Protected Attributes | |
ObjectMatch | ignore |
Name match for objects to ignore. More... | |
Debug logging base class.
Handles formatting and outputting time/name/message messages
|
inline |
Add objects to ignore.
Definition at line 94 of file trace.hh.
References ObjectMatch::add(), and ignore.
Referenced by ignore().
|
inline |
Log a single message.
Definition at line 56 of file trace.hh.
References dprintf_flag(), and name().
|
inline |
Log a single message with a flag prefix.
Definition at line 64 of file trace.hh.
References ccprintf(), ignore, logMessage(), ObjectMatch::match(), and name().
Referenced by dprintf(), and Trace::ExeTracerRecord::traceInst().
void Logger::dump | ( | Tick | when, |
const std::string & | name, | ||
const void * | d, | ||
int | len, | ||
const std::string & | flag | ||
) |
Dump a block of data of length len.
Definition at line 107 of file trace.cc.
References ArmISA::c, ccprintf(), ArmISA::d, data, ArmISA::i, ignore, ArmISA::j, ArmISA::len, logMessage(), ObjectMatch::match(), and name().
|
pure virtual |
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages.
This can be implemented to use a logger's underlying ostream, to provide an ostream which formats the output in some way, or just set to one of std::cout, std::cerr
Implemented in Trace::OstreamLogger.
Referenced by Trace::output().
|
pure virtual |
Log formatted message.
Implemented in Trace::OstreamLogger.
Referenced by dprintf_flag(), and dump().
|
inline |
|
protected |
Name match for objects to ignore.
Definition at line 51 of file trace.hh.
Referenced by addIgnore(), dprintf_flag(), dump(), Trace::OstreamLogger::logMessage(), and setIgnore().