gem5  v21.1.0.2
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)

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)

Definition at line 186 of file trace.hh.

◆ DPRINTFN

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

Definition at line 214 of file trace.hh.

◆ DPRINTFNR

#define DPRINTFNR (   ...)
Value:
do { \
if (TRACING_ON) { \
(::gem5::Tick)-1, "", __VA_ARGS__); \
} \
} while (0)

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)

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 sc_core::sc_in< sc_dt::sc_lv< W > >::add_trace(), sc_core::sc_in< bool >::add_trace(), sc_core::sc_in< sc_dt::sc_logic >::add_trace(), gem5::statistics::Hdf5::addMetaData(), sc_gem5::VcdTraceFile::addNewTraceVal(), gem5::statistics::Group::addStatGroup(), 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_gem5::TlmInitiatorBaseWrapper< BITWIDTH >::bind(), sc_gem5::ScPortWrapper< IF >::bind(), sc_gem5::ScInterfaceWrapper< IF >::bind(), sc_gem5::ScExportWrapper< IF >::bind(), sc_core::sc_signal< sc_dt::sc_int< 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(), sc_core::sc_signal< sc_dt::sc_bigint< 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(), sc_core::sc_in_rv< W >::end_of_elaboration(), gem5::scmi::EndBitUnion(), gem5::Iris::ThreadContext::extractResourceId(), gem5::Iris::ThreadContext::extractResourceMap(), gem5::OutputDirectory::find(), gem5::loader::SymbolTable::find(), sc_gem5::findEvent(), gem5::debug::findFlag(), sc_gem5::findObject(), gem5::OutputDirectory::findOrCreate(), gem5::BaseXBar::findPort(), gem5::StubSlavePortHandler::getExternalPort(), gem5::gethostnameFunc(), gem5::statistics::Group::Group(), gem5::loader::ElfObject::handleLoadableSegment(), 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::BaseXBar::recvRangeChange(), sc_core::sc_signal< sc_dt::sc_int< 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(), sc_core::sc_signal< sc_dt::sc_bigint< W > >::register_port(), gem5::Ticked::regStats(), gem5::CheckerThreadContext< TC >::regStats(), gem5::BaseXBar::regStats(), sc_core::sc_attr_cltn::remove(), gem5::OutputDirectory::remove(), gem5::OutputDirectory::resolve(), gem5::statistics::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::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::SparcISA::unameFunc(), gem5::X86ISA::unameFunc(), gem5::MipsISA::unameFunc(), gem5::PowerISA::unameFunc(), gem5::ArmISA::unameFunc32(), gem5::RiscvISA::unameFunc32(), gem5::RiscvISA::unameFunc64(), gem5::ArmISA::unameFunc64(), gem5::MemState::unserialize(), gem5::loader::SymbolTable::unserialize(), gem5::Serializable::unserializeSection(), and gem5::statistics::validateStatName().

gem5::curTick
Tick curTick()
The universal simulation clock.
Definition: cur_tick.hh:46
gem5::Trace::Logger::dprintf_flag
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
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::Trace::getDebugLogger
Logger * getDebugLogger()
Get the current global debug logger.
Definition: trace.cc:69
gem5::X86ISA::count
count
Definition: misc.hh:709
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::ArmISA::s
Bitfield< 4 > s
Definition: misc_types.hh:561
gem5::RiscvISA::x
Bitfield< 3 > x
Definition: pagetable.hh:73
gem5::Trace::Logger::dprintf
void dprintf(Tick when, const std::string &name, const char *fmt, const Args &...args)
Log a single message.
Definition: trace.hh:67
name
const std::string & name()
Definition: trace.cc:49
gem5::Trace::Logger::dump
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

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