gem5  v22.1.0.0
Classes | Namespaces | Functions
trace.hh File Reference
#include <ostream>
#include <string>
#include <sstream>
#include "base/compiler.hh"
#include "base/cprintf.hh"
#include "base/debug.hh"
#include "base/match.hh"
#include "base/types.hh"
#include "sim/cur_tick.hh"

Go to the source code of this file.

Classes

class  gem5::trace::Logger
 Debug logging base class. More...
 
class  gem5::trace::OstreamLogger
 Logging wrapper for ostreams with the format: <when>: <name>: <message-body> More...
 
struct  gem5::StringWrap
 

Namespaces

 gem5
 Reference material can be found at the JEDEC website: UFS standard http://www.jedec.org/standards-documents/results/jesd220 UFS HCI specification http://www.jedec.org/standards-documents/results/jesd223.
 
 gem5::trace
 

Macros

#define DDUMP(x, data, count)
 DPRINTF is a debugging trace facility that allows one to selectively enable tracing statements. More...
 
#define DPRINTF(x, ...)
 
#define DPRINTFS(x, s, ...)
 
#define DPRINTFR(x, ...)
 
#define DPRINTFV(x, ...)
 
#define DPRINTFN(...)
 
#define DPRINTFNR(...)
 
#define DPRINTF_UNCONDITIONAL(x, ...)
 

Functions

const std::string & name ()
 
Logger * gem5::trace::getDebugLogger ()
 Get the current global debug logger. More...
 
std::ostream & gem5::trace::output ()
 Get the ostream from the current global logger. More...
 
void gem5::trace::setDebugLogger (Logger *logger)
 Delete the current global logger and assign a new one. More...
 
void gem5::trace::enable ()
 Enable/disable debug logging. More...
 
void gem5::trace::disable ()
 

Macro Definition Documentation

◆ DDUMP

#define DDUMP (   x,
  data,
  count 
)
Value:
do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) \
::gem5::curTick(), name(), data, count, #x); \
} while (0)
const std::string & name()
Definition: trace.cc:49
const char data[]
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.
Definition: trace.cc:109
Bitfield< 4 > x
Definition: pagetable.hh:61
Logger * getDebugLogger()
Get the current global debug logger.
Definition: trace.cc:69
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46

DPRINTF is a debugging trace facility that allows one to selectively enable tracing statements.

To use DPRINTF, there must be a function or functor called name() that returns a const std::string & in the current scope.

If you desire that the automatic printing not occur, use DPRINTFR (R for raw)

With DPRINTFV it is possible to pass a debug::SimpleFlag variable as first argument. Example:

debug::Flag some_flag = debug::DMA; DPRINTFV(some_flag, ...);

Definition at line 180 of file trace.hh.

◆ DPRINTF

#define DPRINTF (   x,
  ... 
)
Value:
do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
::gem5::curTick(), name(), #x, __VA_ARGS__); \
} \
} while (0)
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.
Definition: trace.hh:75

Definition at line 186 of file trace.hh.

◆ DPRINTFN

#define DPRINTFN (   ...)
Value:
do { \
if (TRACING_ON) { \
::gem5::curTick(), name(), __VA_ARGS__); \
} \
} while (0)
void dprintf(Tick when, const std::string &name, const char *fmt, const Args &...args)
Log a single message.
Definition: trace.hh:67

Definition at line 214 of file trace.hh.

◆ DPRINTFNR

#define DPRINTFNR (   ...)
Value:
do { \
if (TRACING_ON) { \
(::gem5::Tick)-1, "", __VA_ARGS__); \
} \
} while (0)
uint64_t Tick
Tick count type.
Definition: types.hh:58

Definition at line 221 of file trace.hh.

◆ DPRINTFR

#define DPRINTFR (   x,
  ... 
)
Value:
do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
(::gem5::Tick)-1, std::string(), #x, __VA_ARGS__); \
} \
} while (0)

Definition at line 200 of file trace.hh.

◆ DPRINTFS

#define DPRINTFS (   x,
  s,
  ... 
)
Value:
do { \
if (GEM5_UNLIKELY(TRACING_ON && ::gem5::debug::x)) { \
::gem5::curTick(), (s)->name(), #x, __VA_ARGS__); \
} \
} while (0)
Bitfield< 1 > s
Definition: pagetable.hh:64

Definition at line 193 of file trace.hh.

◆ DPRINTFV

#define DPRINTFV (   x,
  ... 
)
Value:
do { \
if (GEM5_UNLIKELY(TRACING_ON && (x))) { \
::gem5::curTick(), name(), x.name(), __VA_ARGS__); \
} \
} while (0)

Definition at line 207 of file trace.hh.

Function Documentation

◆ name()

const std::string& name ( )

Definition at line 49 of file trace.cc.

Referenced by gem5::statistics::Hdf5::addMetaData(), sc_gem5::VcdTraceFile::addNewTraceVal(), gem5::statistics::Group::addStatGroup(), gem5::CxxConfigParams::AddToConfigDir::AddToConfigDir(), sc_gem5::VcdTraceFile::addTraceVal(), sc_gem5::VcdTraceScope::addValue(), gem5::fastmodel::PL330::allocateIrq(), gem5::arrayParamIn(), gem5::arrayParamOut(), gem5::statistics::Hdf5::beginGroup(), gem5::statistics::Text::beginGroup(), sc_core::sc_signal< sc_dt::sc_int< W > >::check_writer(), sc_core::sc_signal< sc_dt::sc_bigint< W > >::check_writer(), sc_core::sc_signal< sc_dt::sc_uint< W > >::check_writer(), sc_core::sc_signal< sc_dt::sc_biguint< W > >::check_writer(), gem5::OutputDirectory::checkForStdio(), gem5::checkSeg(), gem5::OutputDirectory::create(), gem5::OutputDirectory::createSubdirectory(), gem5::ObjectMatch::domatch(), gem5::trace::Logger::dprintf(), gem5::trace::Logger::dprintf_flag(), gem5::BaseStackTrace::dump(), gem5::trace::Logger::dump(), gem5::dumpSimcall(), gem5::scmi::EndBitUnion(), gem5::Iris::ThreadContext::extractResourceId(), gem5::Iris::ThreadContext::extractResourceMap(), gem5::loader::SymbolTable::find(), gem5::OutputDirectory::find(), sc_gem5::findEvent(), gem5::debug::findFlag(), sc_gem5::findObject(), gem5::OutputDirectory::findOrCreate(), gem5::StubSlavePortHandler::getExternalPort(), gem5::gethostnameFunc(), gem5::statistics::Group::Group(), gem5::loader::ElfObject::handleLoadableSegment(), gem5::EmbeddedPyBind::init(), gem5::X86ISA::Interrupts::init(), gem5::Iris::ThreadContext::instanceRegistryChanged(), gem5::OutputDirectory::isAbsolute(), gem5::OutputDirectory::isFile(), gem5::trace::OstreamLogger::logMessage(), gem5::ObjectMatch::match(), sc_gem5::newCThreadProcess(), sc_gem5::newMethodProcess(), sc_gem5::newThreadProcess(), sc_gem5::VcdTraceFile::nextSignalName(), Nop(), gem5::objParamIn(), gem5::OutputDirectory::open(), sc_core::sc_attr_cltn::operator[](), gem5::optParamIn(), sc_gem5::VcdTraceScope::output(), gem5::OutputDirectory::OutputDirectory(), gem5::paramIn(), gem5::paramInImpl(), gem5::paramOut(), gem5::Iris::ThreadContext::phaseInitLeave(), gem5::fastmodel::PL330::PL330(), gem5::pybind_init_stats(), gem5::PybindModuleInit::PybindModuleInit(), sc_core::sc_signal< sc_dt::sc_int< W > >::register_port(), sc_core::sc_signal< sc_dt::sc_bigint< W > >::register_port(), sc_core::sc_signal< sc_dt::sc_uint< W > >::register_port(), sc_core::sc_signal< sc_dt::sc_biguint< W > >::register_port(), gem5::Ticked::regStats(), gem5::CheckerThreadContext< TC >::regStats(), sc_core::sc_attr_cltn::remove(), gem5::OutputDirectory::remove(), gem5::statistics::resolve(), gem5::OutputDirectory::resolve(), gem5::PybindSimObjectResolver::resolveSimObject(), gem5::CxxConfigManager::SimObjectResolver::resolveSimObject(), gem5::statistics::Group::resolveStat(), sc_core::sc_create_vcd_trace_file(), sc_core::sc_find_event(), sc_core::sc_find_object(), sc_core::sc_hierarchical_name_exists(), SC_MODULE(), sc_core::sc_module_name::sc_module_name(), sc_core::sc_report_compose_message(), sc_core::sc_trace(), sc_core::sc_trace< bool >(), sc_core::sc_trace< sc_dt::sc_logic >(), gem5::fastmodel::SCGIC::SCGIC(), gem5::Serializable::ScopedCheckpointSection::ScopedCheckpointSection(), gem5::fastmodel::ScxEvsCortexA76< Types >::ScxEvsCortexA76(), gem5::fastmodel::ScxEvsCortexR52< Types >::ScxEvsCortexR52(), gem5::Serializable::serializeSection(), gem5::ruby::TimerTable::setDescription(), gem5::CheckpointIn::setDir(), sc_gem5::spawnWork(), gem5::statistics::Text::statName(), TEST(), gem5::MipsISA::unameFunc(), gem5::PowerISA::unameFunc(), gem5::SparcISA::unameFunc(), gem5::X86ISA::unameFunc(), gem5::ArmISA::unameFunc32(), gem5::RiscvISA::unameFunc32(), gem5::ArmISA::unameFunc64(), gem5::RiscvISA::unameFunc64(), gem5::MemState::unserialize(), gem5::loader::SymbolTable::unserialize(), gem5::Serializable::unserializeSection(), and gem5::statistics::validateStatName().


Generated on Wed Dec 21 2022 10:22:54 for gem5 by doxygen 1.9.1