Function call trace service using libunwind. More...
Classes | |
| struct | ProcInfo |
| Information about a memory address. More... | |
Public Member Functions | |
| LibUnwindStackTraceService (const ServiceBuildInfo &sbi) | |
| LibUnwindStackTraceService (ITraceMng *tm) | |
| void | build () override |
| StackTrace | stackTrace (int first_function) override |
| Character string indicating the call stack. | |
| StackTrace | stackTraceFunction (int function_index) override |
| Returns the current call stack. | |
| Public Member Functions inherited from Arcane::TraceAccessor | |
| TraceAccessor (ITraceMng *m) | |
| Constructs an accessor via the trace manager m. | |
| TraceAccessor (const TraceAccessor &rhs) | |
| Copy constructor. | |
| TraceAccessor & | operator= (const TraceAccessor &rhs) |
| Copy assignment operator. | |
| virtual | ~TraceAccessor () |
| Frees resources. | |
| ITraceMng * | traceMng () const |
| Trace manager. | |
| TraceMessage | info () const |
| Flow for an information message. | |
| TraceMessage | pinfo () const |
| Flow for a parallel information message. | |
| TraceMessage | info (char category) const |
| Flow for an information message of a given category. | |
| TraceMessage | pinfo (char category) const |
| Flow for a parallel information message of a given category. | |
| TraceMessage | info (bool v) const |
| Flow for an information message. | |
| TraceMessage | warning () const |
| Flow for a warning message. | |
| TraceMessage | pwarning () const |
| TraceMessage | error () const |
| Flow for an error message. | |
| TraceMessage | perror () const |
| TraceMessage | log () const |
| Flow for a log message. | |
| TraceMessage | plog () const |
| Flow for a log message. | |
| TraceMessage | logdate () const |
| Flow for a log message preceded by the date. | |
| TraceMessage | fatal () const |
| Flow for a fatal error message. | |
| TraceMessage | pfatal () const |
| Flow for a parallel fatal error message. | |
| TraceMessageDbg | debug (Trace::eDebugLevel=Trace::Medium) const |
| Flow for a debug message. | |
| Trace::eDebugLevel | configDbgLevel () const |
| Debug level of the configuration file. | |
| TraceMessage | info (Int32 verbose_level) const |
| Flow for an information message of a given level. | |
| TraceMessage | linfo () const |
| Flow for an information message with the local information level of this instance. | |
| TraceMessage | linfo (Int32 relative_level) const |
| Flow for an information message with the local information level of this instance. | |
| void | fatalMessage (const StandaloneTraceMessage &o) const |
Private Types | |
| using | ProcInfoMap = std::map<unw_word_t, ProcInfo> |
Private Member Functions | |
| ProcInfo | _getFuncInfo (unw_word_t ip, unw_cursor_t *cursor) |
| ProcInfo | _getFuncInfo (const void *ip) |
| Retrieves the function name via dladdr. | |
| String | _getGDBStack () |
| StackTrace | _backtraceStackTrace (const FixedStackFrameArray &stack_frames) |
| Call stack via the backtrace function. | |
| String | _generateFileAndOffset (const FixedStackFrameArray &stack_frames) |
| Generates a list of file names and offsets for a call stack. | |
| FixedStackFrameArray | _backtraceStackFrame (int first_function) |
| Call stack via the backtrace function. | |
Private Attributes | |
| ProcInfoMap | m_proc_name_map |
| std::mutex | m_proc_name_map_mutex |
| bool | m_want_gdb_info = false |
| bool | m_use_backtrace = false |
| DWHandler | m_dw_handler |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::TraceAccessor | |
| void | _setLocalVerboseLevel (Int32 v) |
| Int32 | _localVerboseLevel () const |
Function call trace service using libunwind.
Definition at line 178 of file LibUnwindStackTraceService.cc.
|
private |
Definition at line 243 of file LibUnwindStackTraceService.cc.
|
inlineexplicit |
Definition at line 216 of file LibUnwindStackTraceService.cc.
|
inlineexplicit |
Definition at line 220 of file LibUnwindStackTraceService.cc.
|
private |
Call stack via the backtrace function.
Definition at line 489 of file LibUnwindStackTraceService.cc.
References Arcane::FixedStackFrameArray::addFrame().
Referenced by stackTrace().
|
private |
Call stack via the backtrace function.
Definition at line 506 of file LibUnwindStackTraceService.cc.
References Arcane::TraceAccessor::pinfo().
Referenced by stackTrace().
|
private |
Generates a list of file names and offsets for a call stack.
Generates a character string containing for each address in the call stack stack_frames the name of the file containing the symbol and the offset of this address in that file.
The output format allows reading by tools such as addr2line or llmv-symbolizer.
Definition at line 541 of file LibUnwindStackTraceService.cc.
References Arcane::TraceAccessor::pinfo().
Referenced by stackTrace().
|
private |
Retrieves the function name via dladdr.
Definition at line 317 of file LibUnwindStackTraceService.cc.
References Arcane::LibUnwindStackTraceService::ProcInfo::m_name.
|
private |
Definition at line 261 of file LibUnwindStackTraceService.cc.
|
private |
Definition at line 358 of file LibUnwindStackTraceService.cc.
|
inlineoverridevirtual |
Implements Arcane::IStackTraceService.
Definition at line 227 of file LibUnwindStackTraceService.cc.
|
overridevirtual |
Character string indicating the call stack.
Implements Arcane::IStackTraceService.
Definition at line 381 of file LibUnwindStackTraceService.cc.
References _backtraceStackFrame(), _backtraceStackTrace(), _generateFileAndOffset(), Arcane::FixedStackFrameArray::addFrame(), Arcane::platform::getSymbolizerService(), Arcane::LibUnwindStackTraceService::ProcInfo::m_name, and Arcane::ISymbolizerService::stackTrace().
|
overridevirtual |
Returns the current call stack.
The first function_index functions of the stack are ignored.
Implements Arcane::IStackTraceService.
Definition at line 455 of file LibUnwindStackTraceService.cc.
References Arcane::LibUnwindStackTraceService::ProcInfo::m_name, and Arcane::StringBuilder::toString().
|
private |
Definition at line 249 of file LibUnwindStackTraceService.cc.
|
private |
Definition at line 244 of file LibUnwindStackTraceService.cc.
|
private |
Definition at line 245 of file LibUnwindStackTraceService.cc.
|
private |
Definition at line 248 of file LibUnwindStackTraceService.cc.
|
private |
Definition at line 247 of file LibUnwindStackTraceService.cc.