| The Gaudi Framework v32r1 (f65d50dc)

Classes | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
IgHookTrace Class Reference

`#include <src/component/IgHook_IgHookTrace.h>`

Collaboration diagram for IgHookTrace:
[legend]

## Classes
struct | Counter
| Nearly dummy object type to identify a counter. More...
class | CounterValue
| Value for a counter chained from a trace. More...

## Public Member Functions
void * | operator new (size_t n, IgHookTraceAlloc *alloc=0)
| IgHookTrace (IgHookTrace *parent=0, void *address=0)
IgHookTrace * | parent (void)
IgHookTrace * | next (void)
void * | address (void)
bool | symbol (const char *&sym, const char *&lib, int &offset, int &liboffset)
IgHookTrace * | children (void)
IgHookTrace * | child (void *address)
CounterValue * | counters (void)
CounterValue * | counter (Counter *id)
void | merge (IgHookTrace *other)

## Static Public Member Functions
static int | stacktrace (void **addresses, int nmax)
static void * | tosymbol (void *address)
static bool | symbol (void *address, const char *&sym, const char *&lib, int &offset, int &liboffset)

## Private Attributes
IgHookTraceAlloc * | m_alloc
IgHookTrace * | m_parent
IgHookTrace * | m_next
IgHookTrace * | m_children
void * | m_address
CounterValue * | m_counters

## Detailed Description

Definition at line 27 of file IgHook_IgHookTrace.h.

## Constructor & Destructor Documentation

## ◆ IgHookTrace()

IgHookTrace::IgHookTrace | ( | IgHookTrace * | parent = `0`,
|  | void * | address = `0`
| ) |  |

Definition at line 196 of file IgHook_IgHookTrace.cpp.

197 : m_alloc( parent ? parent->m_alloc : new IgHookTraceAlloc )
198 , m_parent( parent )
199 , m_next( parent ? parent->m_children : 0 )
200 , m_children( 0 )
201 , m_address( address )
202 , m_counters( 0 ) {
203 if ( m_parent ) m_parent->m_children = this;
204 }
IgHookTrace::parent
IgHookTrace * parent(void)
Definition: IgHook_IgHookTrace.cpp:206
IgHookTrace::m_children
IgHookTrace * m_children
Definition: IgHook_IgHookTrace.h:93
IgHookTrace::m_parent
IgHookTrace * m_parent
Definition: IgHook_IgHookTrace.h:91
IgHookTrace::address
void * address(void)
Definition: IgHook_IgHookTrace.cpp:210
IgHookTrace::m_next
IgHookTrace * m_next
Definition: IgHook_IgHookTrace.h:92
IgHookTrace::m_counters
CounterValue * m_counters
Definition: IgHook_IgHookTrace.h:95
IgHookTrace::m_alloc
IgHookTraceAlloc * m_alloc
Definition: IgHook_IgHookTrace.h:90
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:94
IgHookTraceAlloc
Definition: IgHook_IgHookTrace.h:16

## Member Function Documentation

## ◆ address()

void * IgHookTrace::address | ( | void |  | ) |

Definition at line 210 of file IgHook_IgHookTrace.cpp.

210 { return m_address; }
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:94

## ◆ child()

IgHookTrace* IgHookTrace::child | ( | void * | address | ) |

## ◆ children()

IgHookTrace* IgHookTrace::children | ( | void |  | ) |

## ◆ counter()

CounterValue* IgHookTrace::counter | ( | Counter * | id | ) |

## ◆ counters()

CounterValue* IgHookTrace::counters | ( | void |  | ) |

## ◆ merge()

void IgHookTrace::merge | ( | IgHookTrace * | other | ) |

## ◆ next()

IgHookTrace * IgHookTrace::next | ( | void |  | ) |

Definition at line 208 of file IgHook_IgHookTrace.cpp.

208 { return m_next; }
IgHookTrace::m_next
IgHookTrace * m_next
Definition: IgHook_IgHookTrace.h:92

## ◆ operator new()

void * IgHookTrace::operator new | ( | size_t | n,
|  | IgHookTraceAlloc * | alloc = `0`
| ) |  |

Definition at line 192 of file IgHook_IgHookTrace.cpp.

192 {
193 return alloc ? alloc->allocate( n ) : ::operator new( n );
194 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
IgHookTraceAlloc::allocate
void * allocate(size_t bytes)
Definition: IgHook_IgHookTrace.cpp:101

## ◆ parent()

IgHookTrace * IgHookTrace::parent | ( | void |  | ) |

Definition at line 206 of file IgHook_IgHookTrace.cpp.

206 { return m_parent; }
IgHookTrace::m_parent
IgHookTrace * m_parent
Definition: IgHook_IgHookTrace.h:91

## ◆ stacktrace()

static int IgHookTrace::stacktrace | ( | void ** | addresses,
|  | int | nmax
| ) |  |
| static

## ◆ symbol() [1/2]

bool IgHookTrace::symbol | ( | void * | address,
|  | const char *& | sym,
|  | const char *& | lib,
|  | int & | offset,
|  | int & | liboffset
| ) |  |
| static

Definition at line 212 of file IgHook_IgHookTrace.cpp.

212 {
213 sym = lib = 0;
214 offset = 0;
215 liboffset = (unsigned long)address;
216
217 Dl_info info;
218 if ( dladdr( address, &info ) ) {
219 if ( info.dli_fname && info.dli_fname[0] ) lib = info.dli_fname;
220
221 if ( info.dli_fbase ) liboffset = (unsigned long)address - (unsigned long)info.dli_fbase;
222
223 if ( info.dli_saddr ) offset = (unsigned long)address - (unsigned long)info.dli_saddr;
224
225 if ( info.dli_sname && info.dli_sname[0] ) sym = info.dli_sname;
226
227 return true;
228 }
229
230 return false;
231 }
IgHookTrace::address
void * address(void)
Definition: IgHook_IgHookTrace.cpp:210

## ◆ symbol() [2/2]

bool IgHookTrace::symbol | ( | const char *& | sym,
|  | const char *& | lib,
|  | int & | offset,
|  | int & | liboffset
| ) |  |

Definition at line 233 of file IgHook_IgHookTrace.cpp.

233 {
234 return symbol( m_address, sym, lib, offset, liboffset );
235 }
IgHookTrace::symbol
static bool symbol(void *address, const char *&sym, const char *&lib, int &offset, int &liboffset)
Definition: IgHook_IgHookTrace.cpp:212
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:94

## ◆ tosymbol()

void * IgHookTrace::tosymbol | ( | void * | address | ) |
| static

Definition at line 237 of file IgHook_IgHookTrace.cpp.

237 {
238 Dl_info info;
239 return ( dladdr( address, &info ) && info.dli_fname && info.dli_fname[0] && info.dli_saddr ) ? info.dli_saddr
240 : address;
241 }
IgHookTrace::address
void * address(void)
Definition: IgHook_IgHookTrace.cpp:210

## Member Data Documentation

## ◆ m_address

void* IgHookTrace::m_address
| private

Definition at line 94 of file IgHook_IgHookTrace.h.

## ◆ m_alloc

IgHookTraceAlloc* IgHookTrace::m_alloc
| private

Definition at line 90 of file IgHook_IgHookTrace.h.

## ◆ m_children

IgHookTrace* IgHookTrace::m_children
| private

Definition at line 93 of file IgHook_IgHookTrace.h.

## ◆ m_counters

CounterValue* IgHookTrace::m_counters
| private

Definition at line 95 of file IgHook_IgHookTrace.h.

## ◆ m_next

IgHookTrace* IgHookTrace::m_next
| private

Definition at line 92 of file IgHook_IgHookTrace.h.

## ◆ m_parent

IgHookTrace* IgHookTrace::m_parent
| private

Definition at line 91 of file IgHook_IgHookTrace.h.

The documentation for this class was generated from the following files:

- GaudiProfiling/src/component/IgHook_IgHookTrace.h
- GaudiProfiling/src/component/IgHook_IgHookTrace.cpp