gem5  v21.1.0.2
Public Member Functions | Protected Attributes | List of all members
gem5::Trace::Logger Class Referenceabstract

Debug logging base class. More...

#include <trace.hh>

Inheritance diagram for gem5::Trace::Logger:
gem5::Trace::OstreamLogger

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...
 

Detailed Description

Debug logging base class.

Handles formatting and outputting time/name/message messages

Definition at line 58 of file trace.hh.

Constructor & Destructor Documentation

◆ ~Logger()

virtual gem5::Trace::Logger::~Logger ( )
inlinevirtual

Definition at line 107 of file trace.hh.

Member Function Documentation

◆ addIgnore()

void gem5::Trace::Logger::addIgnore ( const ObjectMatch ignore_)
inline

Add objects to ignore.

Definition at line 105 of file trace.hh.

References gem5::ObjectMatch::add(), and ignore.

Referenced by TEST().

◆ dprintf()

template<typename ... Args>
void gem5::Trace::Logger::dprintf ( Tick  when,
const std::string &  name,
const char *  fmt,
const Args &...  args 
)
inline

Log a single message.

Definition at line 67 of file trace.hh.

References dprintf_flag(), and name().

Referenced by TEST().

◆ dprintf_flag()

template<typename ... Args>
void gem5::Trace::Logger::dprintf_flag ( Tick  when,
const std::string &  name,
const std::string &  flag,
const char *  fmt,
const Args &...  args 
)
inline

Log a single message with a flag prefix.

Definition at line 75 of file trace.hh.

References gem5::ccprintf(), ignore, logMessage(), gem5::ObjectMatch::match(), and name().

Referenced by dprintf(), TEST(), and gem5::Trace::ExeTracerRecord::traceInst().

◆ dump()

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 109 of file trace.cc.

References gem5::ArmISA::c, gem5::ccprintf(), gem5::ArmISA::d, data, gem5::ArmISA::i, ignore, gem5::ArmISA::j, gem5::ArmISA::len, logMessage(), gem5::ObjectMatch::match(), and name().

Referenced by TEST().

◆ getOstream()

virtual std::ostream& gem5::Trace::Logger::getOstream ( )
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().

◆ logMessage()

virtual void gem5::Trace::Logger::logMessage ( Tick  when,
const std::string &  name,
const std::string &  flag,
const std::string &  message 
)
pure virtual

Log formatted message.

Implemented in gem5::Trace::OstreamLogger.

Referenced by dprintf_flag(), dump(), and TEST().

◆ setIgnore()

void gem5::Trace::Logger::setIgnore ( ObjectMatch ignore_)
inline

Set objects to ignore.

Definition at line 102 of file trace.hh.

References ignore.

Referenced by TEST().

Member Data Documentation

◆ ignore

ObjectMatch gem5::Trace::Logger::ignore
protected

Name match for objects to ignore.

Definition at line 62 of file trace.hh.

Referenced by addIgnore(), dprintf_flag(), dump(), gem5::Trace::OstreamLogger::logMessage(), and setIgnore().


The documentation for this class was generated from the following files:

Generated on Tue Sep 21 2021 12:32:32 for gem5 by doxygen 1.8.17