The Gaudi Framework  master (37c0b60a)
IgHookTrace Class Reference

#include </builds/gaudi/Gaudi/GaudiProfiling/src/component/IgHook_IgHookTrace.h>

Collaboration diagram for IgHookTrace:

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)
 
IgHookTraceparent (void)
 
IgHookTracenext (void)
 
void * address (void)
 
bool symbol (const char *&sym, const char *&lib, int &offset, int &liboffset)
 
IgHookTracechildren (void)
 
IgHookTracechild (void *address)
 
CounterValuecounters (void)
 
CounterValuecounter (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

IgHookTraceAllocm_alloc
 
IgHookTracem_parent
 
IgHookTracem_next
 
IgHookTracem_children
 
void * m_address
 
CounterValuem_counters
 

Detailed Description

Definition at line 37 of file IgHook_IgHookTrace.h.

Constructor & Destructor Documentation

◆ IgHookTrace()

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

Definition at line 206 of file IgHook_IgHookTrace.cpp.

208  , m_parent( parent )
209  , m_next( parent ? parent->m_children : 0 )
210  , m_children( 0 )
211  , m_address( address )
212  , m_counters( 0 ) {
213  if ( m_parent ) m_parent->m_children = this;
214 }

Member Function Documentation

◆ address()

void * IgHookTrace::address ( void  )

Definition at line 220 of file IgHook_IgHookTrace.cpp.

220 { return m_address; }

◆ 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 218 of file IgHook_IgHookTrace.cpp.

218 { return m_next; }

◆ operator new()

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

Definition at line 202 of file IgHook_IgHookTrace.cpp.

202  {
203  return alloc ? alloc->allocate( n ) : ::operator new( n );
204 }

◆ parent()

IgHookTrace * IgHookTrace::parent ( void  )

Definition at line 216 of file IgHook_IgHookTrace.cpp.

216 { return m_parent; }

◆ stacktrace()

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

◆ symbol() [1/2]

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

Definition at line 243 of file IgHook_IgHookTrace.cpp.

243  {
244  return symbol( m_address, sym, lib, offset, liboffset );
245 }

◆ symbol() [2/2]

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

Definition at line 222 of file IgHook_IgHookTrace.cpp.

222  {
223  sym = lib = 0;
224  offset = 0;
225  liboffset = (unsigned long)address;
226 
227  Dl_info info;
228  if ( dladdr( address, &info ) ) {
229  if ( info.dli_fname && info.dli_fname[0] ) lib = info.dli_fname;
230 
231  if ( info.dli_fbase ) liboffset = (unsigned long)address - (unsigned long)info.dli_fbase;
232 
233  if ( info.dli_saddr ) offset = (unsigned long)address - (unsigned long)info.dli_saddr;
234 
235  if ( info.dli_sname && info.dli_sname[0] ) sym = info.dli_sname;
236 
237  return true;
238  }
239 
240  return false;
241 }

◆ tosymbol()

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

Definition at line 247 of file IgHook_IgHookTrace.cpp.

247  {
248  Dl_info info;
249  return ( dladdr( address, &info ) && info.dli_fname && info.dli_fname[0] && info.dli_saddr ) ? info.dli_saddr
250  : address;
251 }

Member Data Documentation

◆ m_address

void* IgHookTrace::m_address
private

Definition at line 104 of file IgHook_IgHookTrace.h.

◆ m_alloc

IgHookTraceAlloc* IgHookTrace::m_alloc
private

Definition at line 100 of file IgHook_IgHookTrace.h.

◆ m_children

IgHookTrace* IgHookTrace::m_children
private

Definition at line 103 of file IgHook_IgHookTrace.h.

◆ m_counters

CounterValue* IgHookTrace::m_counters
private

Definition at line 105 of file IgHook_IgHookTrace.h.

◆ m_next

IgHookTrace* IgHookTrace::m_next
private

Definition at line 102 of file IgHook_IgHookTrace.h.

◆ m_parent

IgHookTrace* IgHookTrace::m_parent
private

Definition at line 101 of file IgHook_IgHookTrace.h.


The documentation for this class was generated from the following files:
IgHookTrace::parent
IgHookTrace * parent(void)
Definition: IgHook_IgHookTrace.cpp:216
IgHookTraceAlloc::allocate
void * allocate(size_t bytes)
Definition: IgHook_IgHookTrace.cpp:111
IgHookTraceAlloc
Definition: IgHook_IgHookTrace.h:26
IgHookTrace::m_next
IgHookTrace * m_next
Definition: IgHook_IgHookTrace.h:102
IgHookTrace::m_counters
CounterValue * m_counters
Definition: IgHook_IgHookTrace.h:105
IgHookTrace::m_parent
IgHookTrace * m_parent
Definition: IgHook_IgHookTrace.h:101
IgHookTrace::m_children
IgHookTrace * m_children
Definition: IgHook_IgHookTrace.h:103
IgHookTrace::symbol
static bool symbol(void *address, const char *&sym, const char *&lib, int &offset, int &liboffset)
Definition: IgHook_IgHookTrace.cpp:222
IgHookTrace::address
void * address(void)
Definition: IgHook_IgHookTrace.cpp:220
cpluginsvc.n
n
Definition: cpluginsvc.py:234
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:104
IgHookTrace::m_alloc
IgHookTraceAlloc * m_alloc
Definition: IgHook_IgHookTrace.h:100