| The Gaudi Framework v32r1 (f65d50dc)

IgHook_IgHookTrace.h
Go to the documentation of this file.
1 #ifndef IG_HOOK_IG_HOOK_TRACE_H
2 #define IG_HOOK_IG_HOOK_TRACE_H
3
4 //<<<<<< INCLUDES >>>>>>
5
6 #include <cstddef>
7 #include <new>
8
9 //<<<<<< PUBLIC DEFINES >>>>>>
10 //<<<<<< PUBLIC CONSTANTS >>>>>>
11 //<<<<<< PUBLIC TYPES >>>>>>
12 //<<<<<< PUBLIC VARIABLES >>>>>>
13 //<<<<<< PUBLIC FUNCTIONS >>>>>>
14 //<<<<<< CLASS DECLARATIONS >>>>>>
15
16 class IgHookTraceAlloc {
17 public:
18 IgHookTraceAlloc( void );
19
20 void* allocate( size_t bytes );
21
22 private:
23 void* m_pool;
24 size_t m_left;
25 };
26
27 class IgHookTrace {
28 public:
30 struct Counter {
31 const char* m_name;
32 };
33
35 class CounterValue {
36 public:
37 void* operator new( size_t n, IgHookTraceAlloc* alloc = 0 );
38
39 CounterValue( Counter* counter, CounterValue* next = 0, unsigned long long value = 0 );
40 // implicit copy constructor
41 // implicit assignment operator
42 // implicit destructor
43
44 Counter* counter( void );
45 CounterValue* next( void );
46 unsigned long long count( void );
47
48 unsigned long long value( void );
49 unsigned long long tick( void );
50 unsigned long long untick( void );
51 unsigned long long add( unsigned long long value );
52 unsigned long long add( CounterValue& x );
53 unsigned long long sub( unsigned long long value );
54 unsigned long long sub( CounterValue& x );
55 unsigned long long max( unsigned long long value );
56 unsigned long long max( CounterValue& x );
57
58 private:
59 Counter* m_counter;
60 CounterValue* m_next;
61 unsigned long long m_value;
62 unsigned long long m_count;
63 };
64
65 // General utilities
66 static int stacktrace( void** addresses, int nmax );
67 static void* tosymbol( void* address );
68 static bool symbol( void* address, const char*& sym, const char*& lib, int& offset, int& liboffset );
69
70 void* operator new( size_t n, IgHookTraceAlloc* alloc = 0 );
71
72 // Class methods
73 IgHookTrace( IgHookTrace* parent = 0, void* address = 0 );
74
75 IgHookTrace* parent( void );
76 IgHookTrace* next( void );
77
78 void* address( void );
79 bool symbol( const char*& sym, const char*& lib, int& offset, int& liboffset );
80
81 IgHookTrace* children( void );
82 IgHookTrace* child( void* address );
83
84 CounterValue* counters( void );
85 CounterValue* counter( Counter* id );
86
87 void merge( IgHookTrace* other );
88
89 private:
90 IgHookTraceAlloc* m_alloc;
91 IgHookTrace* m_parent;
92 IgHookTrace* m_next;
93 IgHookTrace* m_children;
94 void* m_address;
95 CounterValue* m_counters;
96 };
97
98 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
99 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
100
101 #endif // IG_HOOK_IG_HOOK_TRACE_H
IgHookTrace::CounterValue::next
CounterValue * next(void)
Definition: IgHook_IgHookTrace.cpp:139
IgHookTrace::tosymbol
static void * tosymbol(void *address)
Definition: IgHook_IgHookTrace.cpp:237
IgHookTraceAlloc::m_left
size_t m_left
Definition: IgHook_IgHookTrace.h:24
IgHookTrace::parent
IgHookTrace * parent(void)
Definition: IgHook_IgHookTrace.cpp:206
IgHookTrace::CounterValue::untick
unsigned long long untick(void)
Definition: IgHook_IgHookTrace.cpp:150
IgHookTrace::CounterValue::m_next
CounterValue * m_next
Definition: IgHook_IgHookTrace.h:60
IgHookTrace::CounterValue::m_counter
Counter * m_counter
Definition: IgHook_IgHookTrace.h:59
IgHookTrace::counter
CounterValue * counter(Counter *id)
IgHookTrace
Definition: IgHook_IgHookTrace.h:27
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
IgHookTrace::m_children
IgHookTrace * m_children
Definition: IgHook_IgHookTrace.h:93
IgHookTrace::CounterValue::add
unsigned long long add(unsigned long long value)
Definition: IgHook_IgHookTrace.cpp:155
IgHookTrace::m_parent
IgHookTrace * m_parent
Definition: IgHook_IgHookTrace.h:91
IgHookTrace::child
IgHookTrace * child(void *address)
IgHookTrace::CounterValue::counter
Counter * counter(void)
Definition: IgHook_IgHookTrace.cpp:137
IgHookTrace::children
IgHookTrace * children(void)
IgHookTrace::CounterValue::tick
unsigned long long tick(void)
Definition: IgHook_IgHookTrace.cpp:145
IgHookTrace::address
void * address(void)
Definition: IgHook_IgHookTrace.cpp:210
IgHookTrace::CounterValue
Value for a counter chained from a trace.
Definition: IgHook_IgHookTrace.h:35
IgHookTrace::counters
CounterValue * counters(void)
IgHookTrace::stacktrace
static int stacktrace(void **addresses, int nmax)
IgHookTrace::symbol
static bool symbol(void *address, const char *&sym, const char *&lib, int &offset, int &liboffset)
Definition: IgHook_IgHookTrace.cpp:212
IgHookTrace::CounterValue::max
unsigned long long max(unsigned long long value)
Definition: IgHook_IgHookTrace.cpp:165
IgHookTrace::CounterValue::value
unsigned long long value(void)
Definition: IgHook_IgHookTrace.cpp:141
IgHookTrace::CounterValue::m_value
unsigned long long m_value
Definition: IgHook_IgHookTrace.h:61
IgHookTrace::CounterValue::sub
unsigned long long sub(unsigned long long value)
Definition: IgHook_IgHookTrace.cpp:160
IgHookTrace::Counter
Nearly dummy object type to identify a counter.
Definition: IgHook_IgHookTrace.h:30
IgHookTrace::Counter::m_name
const char * m_name
Definition: IgHook_IgHookTrace.h:31
IgHookTrace::m_next
IgHookTrace * m_next
Definition: IgHook_IgHookTrace.h:92
IgHookTrace::CounterValue::CounterValue
CounterValue(Counter *counter, CounterValue *next=0, unsigned long long value=0)
Definition: IgHook_IgHookTrace.cpp:133
IgHookTrace::CounterValue::m_count
unsigned long long m_count
Definition: IgHook_IgHookTrace.h:62
IgHookTrace::m_counters
CounterValue * m_counters
Definition: IgHook_IgHookTrace.h:95
IgHookTrace::merge
void merge(IgHookTrace *other)
IgHookTrace::m_alloc
IgHookTraceAlloc * m_alloc
Definition: IgHook_IgHookTrace.h:90
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:94
IgHookTrace::CounterValue::count
unsigned long long count(void)
Definition: IgHook_IgHookTrace.cpp:143
IgHookTrace::IgHookTrace
IgHookTrace(IgHookTrace *parent=0, void *address=0)
Definition: IgHook_IgHookTrace.cpp:196
IgHookTraceAlloc::IgHookTraceAlloc
IgHookTraceAlloc(void)
Definition: IgHook_IgHookTrace.cpp:99
IgHookTraceAlloc
Definition: IgHook_IgHookTrace.h:16
IgHookTrace::next
IgHookTrace * next(void)
Definition: IgHook_IgHookTrace.cpp:208
IgHookTraceAlloc::m_pool
void * m_pool
Definition: IgHook_IgHookTrace.h:23
IgHookTraceAlloc::allocate
void * allocate(size_t bytes)
Definition: IgHook_IgHookTrace.cpp:101