gem5 v23.0.0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros
logging.hh File Reference
#include <cassert>
#include <sstream>
#include <utility>
#include "base/compiler.hh"
#include "base/cprintf.hh"

Go to the source code of this file.

Classes

class  gem5::Logger
 
struct  gem5::Logger::Loc
 

Namespaces

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

Macros

#define base_message(logger, ...)
 
#define base_message_once(logger, ...)
 
#define exit_message(logger, ...)
 
#define panic(...)   exit_message(::gem5::Logger::getPanic(), __VA_ARGS__)
 This implements a cprintf based panic() function.
 
#define fatal(...)   exit_message(::gem5::Logger::getFatal(), __VA_ARGS__)
 This implements a cprintf based fatal() function.
 
#define panic_if(cond, ...)
 Conditional panic macro that checks the supplied condition and only panics if the condition is true and allows the programmer to specify diagnostic printout.
 
#define fatal_if(cond, ...)
 Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condition is true and allows the programmer to specify diagnostic printout.
 
#define NDEBUG_DEFINED   0
 
#define gem5_assert(cond, ...)
 The assert macro will function like a normal assert, but will use panic instead of straight abort().
 
#define chatty_assert(...)
 
#define warn(...)   base_message(::gem5::Logger::getWarn(), __VA_ARGS__)
 
#define inform(...)   base_message(::gem5::Logger::getInfo(), __VA_ARGS__)
 
#define hack(...)   base_message(::gem5::Logger::getHack(), __VA_ARGS__)
 
#define warn_once(...)    base_message_once(::gem5::Logger::getWarn(), __VA_ARGS__)
 
#define inform_once(...)    base_message_once(::gem5::Logger::getInfo(), __VA_ARGS__)
 
#define hack_once(...)    base_message_once(::gem5::Logger::getHack(), __VA_ARGS__)
 
#define warn_if(cond, ...)
 Conditional warning macro that checks the supplied condition and only prints a warning if the condition is true.
 
#define warn_if_once(cond, ...)
 

Macro Definition Documentation

◆ base_message

#define base_message (   logger,
  ... 
)
Value:
[&log = logger](const auto&... args) { \
log.print(::gem5::Logger::Loc(__FILE__, __LINE__), args...); \
}(__VA_ARGS__)

Definition at line 141 of file logging.hh.

◆ base_message_once

#define base_message_once (   logger,
  ... 
)
Value:
[&log = logger](const auto&... args) { \
static bool once{false}; \
if (GEM5_UNLIKELY(!once)) { \
once = true; \
base_message(log, args...); \
} \
}(__VA_ARGS__)

Definition at line 154 of file logging.hh.

◆ chatty_assert

#define chatty_assert (   ...)
Value:
( \
gem5_assert(args...), \
GEM5_DEPRECATED_MACRO(chatty_assert, {}, "Please use gem5_assert()") \
)
#define chatty_assert(...)
Definition logging.hh:332

Definition at line 332 of file logging.hh.

◆ exit_message

#define exit_message (   logger,
  ... 
)
Value:
( \
[&log = logger](const auto&... args) { \
base_message(log, args...); \
}(__VA_ARGS__), \
logger.exit_helper() \
)

Definition at line 170 of file logging.hh.

◆ hack

#define hack (   ...)    base_message(::gem5::Logger::getHack(), __VA_ARGS__)

Definition at line 258 of file logging.hh.

◆ inform

#define inform (   ...)    base_message(::gem5::Logger::getInfo(), __VA_ARGS__)

Definition at line 257 of file logging.hh.

◆ inform_once

#define inform_once (   ...)     base_message_once(::gem5::Logger::getInfo(), __VA_ARGS__)

Definition at line 262 of file logging.hh.

◆ NDEBUG_DEFINED

#define NDEBUG_DEFINED   0

Definition at line 302 of file logging.hh.

◆ warn

#define warn (   ...)    base_message(::gem5::Logger::getWarn(), __VA_ARGS__)

Definition at line 256 of file logging.hh.

◆ warn_if

#define warn_if (   cond,
  ... 
)
Value:
( \
static_cast<bool>(cond) ? \
warn(__VA_ARGS__) : \
void(0) \
)

Conditional warning macro that checks the supplied condition and only prints a warning if the condition is true.

Useful to replace if + warn.

Parameters
condCondition that is checked; if true -> warn
...Printf-based format string with arguments, extends printout.

Definition at line 283 of file logging.hh.

◆ warn_once

#define warn_once (   ...)     base_message_once(::gem5::Logger::getWarn(), __VA_ARGS__)

Definition at line 260 of file logging.hh.


Generated on Mon Jul 10 2023 15:32:07 for gem5 by doxygen 1.9.7