gem5 v24.0.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. | |
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. | |
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. | |
virtual void | logMessage (Tick when, const std::string &name, const std::string &flag, const std::string &message)=0 |
Log formatted message. | |
virtual std::ostream & | getOstream ()=0 |
Return an ostream that can be used to send messages to the 'same place' as formatted logMessage messages. | |
void | setIgnore (ObjectMatch &ignore_) |
Set objects to ignore. | |
void | addIgnore (const ObjectMatch &ignore_) |
Add objects to ignore. | |
void | setActivate (ObjectMatch &activate_) |
Set objects to activate. | |
void | addActivate (const ObjectMatch &activate_) |
Add objects to activate. | |
virtual | ~Logger () |
Protected Member Functions | |
bool | isEnabled (const std::string &name) const |
Protected Attributes | |
ObjectMatch | ignore |
Name match for objects to ignore. | |
ObjectMatch | activate |
Name match for objects to activate log. | |
Debug logging base class.
Handles formatting and outputting time/name/message messages
|
inline |
Add objects to activate.
Definition at line 129 of file trace.hh.
References activate, and gem5::ObjectMatch::add().
Referenced by TEST().
|
inline |
Add objects to ignore.
Definition at line 123 of file trace.hh.
References gem5::ObjectMatch::add(), and ignore.
Referenced by TEST().
|
inline |
|
inline |
Log a single message with a flag prefix.
Definition at line 93 of file trace.hh.
References gem5::ccprintf(), isEnabled(), logMessage(), and name().
Referenced by dprintf(), gem5::RegisterBank< BankByteOrder >::read(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), gem5::trace::ExeTracerRecord::traceInst(), and gem5::RegisterBank< BankByteOrder >::write().
void gem5::trace::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 108 of file trace.cc.
References gem5::ArmISA::c, gem5::ccprintf(), gem5::ArmISA::d, data, gem5::ArmISA::i, isEnabled(), gem5::ArmISA::len, logMessage(), 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 gem5::trace::OstreamLogger.
Referenced by getString(), and gem5::trace::output().
|
inlineprotected |
Definition at line 67 of file trace.hh.
References activate, gem5::ObjectMatch::empty(), ignore, gem5::ObjectMatch::match(), name(), and panic.
Referenced by dprintf_flag(), dump(), and gem5::trace::OstreamLogger::logMessage().
|
pure virtual |
Log formatted message.
Implemented in gem5::trace::OstreamLogger.
Referenced by dprintf_flag(), dump(), TEST(), and TEST().
|
inline |
|
inline |
|
protected |
Name match for objects to activate log.
Definition at line 65 of file trace.hh.
Referenced by addActivate(), isEnabled(), and setActivate().
|
protected |
Name match for objects to ignore.
Definition at line 63 of file trace.hh.
Referenced by addIgnore(), isEnabled(), and setIgnore().