userver: logging::stacktrace_cache Namespace Reference
Loading...
Searching...
No Matches
logging::stacktrace_cache Namespace Reference

Detailed Description

Cached stringification for stack traces.

Classes

class  StacktraceGuard

Functions

std::string to_string (const boost::stacktrace::stacktrace &st)
std::string SymbolizeAddress (const void *pc)
 Resolve a single instruction address to a function name, using the same per-frame cache as stacktrace_cache::to_string().
bool GlobalEnableStacktrace (bool enable)

Function Documentation

◆ GlobalEnableStacktrace()

bool logging::stacktrace_cache::GlobalEnableStacktrace ( bool enable)

Enable/disable stacktraces. If disabled, stacktrace_cache::to_string() returns with a const string.

Note
Disabling stacktraces is a hack for the Boost.Stacktrace memory leak

◆ SymbolizeAddress()

std::string logging::stacktrace_cache::SymbolizeAddress ( const void * pc)

Resolve a single instruction address to a function name, using the same per-frame cache as stacktrace_cache::to_string().

Unlike stacktrace_cache::to_string(), the name is returned unfiltered: no frame is blanked out, so the result is usable for profile symbolization.

Returns
The function name, or an empty string if the address cannot be resolved or if stacktraces are disabled via GlobalEnableStacktrace().

◆ to_string()

std::string logging::stacktrace_cache::to_string ( const boost::stacktrace::stacktrace & st)

Get cached stacktrace

See also
GlobalEnableStacktrace