| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Classes | Public Member Functions | Static Public Member Functions | Private Attributes

# IgHookTrace Class Reference

`#include <IgHook_IgHookTrace.h>`

Collaboration diagram for IgHookTrace:
[legend]

List of all members.

## 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 * | parent = `0`,
|  | void * | address = `0`
| ) |  |

Definition at line 205 of file IgHook_IgHookTrace.cpp.

        : m_alloc (parent ? parent->m_alloc : new IgHookTraceAlloc),
          m_parent (parent),
          m_next (parent ? parent->m_children : 0),
          m_children (0),
          m_address (address),
          m_counters (0)
    { if (m_parent) m_parent->m_children = this; }

## Member Function Documentation

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

Definition at line 223 of file IgHook_IgHookTrace.cpp.

    { return m_address; }

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

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

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

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

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

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

Definition at line 219 of file IgHook_IgHookTrace.cpp.

    { return m_next; }

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

Definition at line 202 of file IgHook_IgHookTrace.cpp.

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

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

Definition at line 215 of file IgHook_IgHookTrace.cpp.

    { return m_parent; }

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

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

Definition at line 227 of file IgHook_IgHookTrace.cpp.

    {
        sym = lib = 0;
        offset = 0;
        liboffset = (unsigned long) address;

        Dl_info info;
        if (dladdr (address, &info))
        {
            if (info.dli_fname && info.dli_fname [0])
                lib = info.dli_fname;

            if (info.dli_fbase)
                liboffset = (unsigned long) address - (unsigned long) info.dli_fbase;

            if (info.dli_saddr)
                offset = (unsigned long) address - (unsigned long) info.dli_saddr;

            if (info.dli_sname && info.dli_sname [0])
                sym = info.dli_sname;

            return true;
        }

        return false;
    }

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

Definition at line 259 of file IgHook_IgHookTrace.cpp.

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

void * IgHookTrace::tosymbol | ( | void * | address ) | `[static]`

Definition at line 263 of file IgHook_IgHookTrace.cpp.

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

## Member Data Documentation

void* IgHookTrace::m_address`[private]`

Definition at line 99 of file IgHook_IgHookTrace.h.

IgHookTraceAlloc* IgHookTrace::m_alloc`[private]`

Definition at line 95 of file IgHook_IgHookTrace.h.

IgHookTrace* IgHookTrace::m_children`[private]`

Definition at line 98 of file IgHook_IgHookTrace.h.

CounterValue* IgHookTrace::m_counters`[private]`

Definition at line 100 of file IgHook_IgHookTrace.h.

IgHookTrace* IgHookTrace::m_next`[private]`

Definition at line 97 of file IgHook_IgHookTrace.h.

IgHookTrace* IgHookTrace::m_parent`[private]`

Definition at line 96 of file IgHook_IgHookTrace.h.

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

- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiProfiling/src/component/IgHook_IgHookTrace.h
- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiProfiling/src/component/IgHook_IgHookTrace.cpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines