libfoedus-core
FOEDUS Core Library
|
APIs to support debugging functionalities. More...
APIs to support debugging functionalities.
Definition at line 35 of file debugging_supports.hpp.
#include <debugging_supports.hpp>
Classes | |
struct | PapiCounters |
Public Member Functions | |
DebuggingSupports ()=delete | |
DebuggingSupports (Engine *engine) | |
ErrorStack | initialize_once () override |
ErrorStack | uninitialize_once () override |
void | set_debug_log_to_stderr (bool value) |
Whether to write debug logs to stderr rather than log file. More... | |
void | set_debug_log_stderr_threshold (DebuggingOptions::DebugLogLevel level) |
Debug logs at or above this level will be copied to stderr. More... | |
void | set_debug_log_min_threshold (DebuggingOptions::DebugLogLevel level) |
Debug logs below this level will be completely ignored. More... | |
void | set_verbose_log_level (int verbose) |
Verbose debug logs (VLOG(m)) at or less than this number will be shown. More... | |
void | set_verbose_module (const std::string &module, int verbose) |
Per-module verbose level. More... | |
ErrorStack | start_profile (const std::string &output_file) |
Start running a CPU profiler (gperftools/PAPI). More... | |
void | stop_profile () |
Stop CPU profiling. More... | |
void | start_papi_counters () |
Start collecting performance counters via PAPI if it's available. More... | |
void | stop_papi_counters () |
Stop collecting performance counters via PAPI. More... | |
const PapiCounters & | get_papi_counters () const |
Returns the profiled PAPI counters. More... | |
![]() | |
DefaultInitializable () | |
virtual | ~DefaultInitializable () |
DefaultInitializable (const DefaultInitializable &)=delete | |
DefaultInitializable & | operator= (const DefaultInitializable &)=delete |
ErrorStack | initialize () override final |
Typical implementation of Initializable::initialize() that provides initialize-once semantics. More... | |
ErrorStack | uninitialize () override final |
Typical implementation of Initializable::uninitialize() that provides uninitialize-once semantics. More... | |
bool | is_initialized () const override final |
Returns whether the object has been already initialized or not. More... | |
![]() | |
virtual | ~Initializable () |
Static Public Member Functions | |
static std::vector< std::string > | describe_papi_counters (const PapiCounters &counters) |
Returns a human-readable explanation of PAPI counters. More... | |
|
delete |
|
inlineexplicit |
Definition at line 43 of file debugging_supports.hpp.
|
static |
Returns a human-readable explanation of PAPI counters.
One string for one counter to avoid returning too long string.
Definition at line 220 of file debugging_supports.cpp.
|
inline |
Returns the profiled PAPI counters.
must be called after stop_profile(). You must call start_profile() with papi_counters=true.
Definition at line 88 of file debugging_supports.hpp.
|
overridevirtual |
Implements foedus::DefaultInitializable.
Definition at line 117 of file debugging_supports.cpp.
References foedus::Engine::is_emulated_child(), and foedus::kRetOk.
void foedus::debugging::DebuggingSupports::set_debug_log_min_threshold | ( | DebuggingOptions::DebugLogLevel | level | ) |
Debug logs below this level will be completely ignored.
Default is kDebugLogInfo. There is an API to change this setting at runtime.
Definition at line 143 of file debugging_supports.cpp.
void foedus::debugging::DebuggingSupports::set_debug_log_stderr_threshold | ( | DebuggingOptions::DebugLogLevel | level | ) |
Debug logs at or above this level will be copied to stderr.
Default is kDebugLogInfo. There is an API to change this setting at runtime.
Definition at line 139 of file debugging_supports.cpp.
void foedus::debugging::DebuggingSupports::set_debug_log_to_stderr | ( | bool | value | ) |
Whether to write debug logs to stderr rather than log file.
Default is false. There is an API to change this setting at runtime.
Definition at line 135 of file debugging_supports.cpp.
void foedus::debugging::DebuggingSupports::set_verbose_log_level | ( | int | verbose | ) |
Verbose debug logs (VLOG(m)) at or less than this number will be shown.
Default is 0. There is an API to change this setting at runtime.
Definition at line 147 of file debugging_supports.cpp.
void foedus::debugging::DebuggingSupports::set_verbose_module | ( | const std::string & | module, |
int | verbose | ||
) |
Per-module verbose level.
The value has to contain a comma-separated list of 'module name'='log level'. 'module name' is a glob pattern (e.g., gfs* for all modules whose name starts with "gfs"), matched against the filename base (that is, name ignoring .cc/.h./-inl.h) Default is "". There is an API to change this setting at runtime.
Definition at line 151 of file debugging_supports.cpp.
void foedus::debugging::DebuggingSupports::start_papi_counters | ( | ) |
Start collecting performance counters via PAPI if it's available.
Definition at line 216 of file debugging_supports.cpp.
ErrorStack foedus::debugging::DebuggingSupports::start_profile | ( | const std::string & | output_file | ) |
Start running a CPU profiler (gperftools/PAPI).
[in] | output_file | path to output the profile result. |
This feature is enabled only when you link to libprofiler.so. For example, use it like this:
Then, after the execution,
Definition at line 229 of file debugging_supports.cpp.
References ERROR_STACK, foedus::kErrorCodeDbgGperftools, foedus::kRetOk, and foedus::assorted::os_error().
void foedus::debugging::DebuggingSupports::stop_papi_counters | ( | ) |
Stop collecting performance counters via PAPI.
Definition at line 219 of file debugging_supports.cpp.
void foedus::debugging::DebuggingSupports::stop_profile | ( | ) |
Stop CPU profiling.
Definition at line 242 of file debugging_supports.cpp.
|
overridevirtual |
Implements foedus::DefaultInitializable.
Definition at line 127 of file debugging_supports.cpp.
References foedus::Engine::is_emulated_child(), and foedus::kRetOk.