| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
18 public:
19 IgHookTraceAlloc( void );
20
21 void* allocate( size_t bytes );
22
23 private:
24 void* m_pool;
25 size_t m_left;
26 };
27
28 class IgHookTrace
29 {
30 public:
32 struct Counter {
33 const char* m_name;
34 };
35
37 class CounterValue
38 {
39 public:
40 void* operator new( size_t n, IgHookTraceAlloc* alloc = 0 );
41
42 CounterValue( Counter* counter, CounterValue* next = 0, unsigned long long value = 0 );
43 // implicit copy constructor
44 // implicit assignment operator
45 // implicit destructor
46
47 Counter* counter( void );
48 CounterValue* next( void );
49 unsigned long long count( void );
50
51 unsigned long long value( void );
52 unsigned long long tick( void );
53 unsigned long long untick( void );
54 unsigned long long add( unsigned long long value );
55 unsigned long long add( CounterValue& x );
56 unsigned long long sub( unsigned long long value );
57 unsigned long long sub( CounterValue& x );
58 unsigned long long max( unsigned long long value );
59 unsigned long long max( CounterValue& x );
60
61 private:
62 Counter* m_counter;
63 CounterValue* m_next;
64 unsigned long long m_value;
65 unsigned long long m_count;
66 };
67
68 // General utilities
69 static int stacktrace( void** addresses, int nmax );
70 static void* tosymbol( void* address );
71 static bool symbol( void* address, const char*& sym, const char*& lib, int& offset, int& liboffset );
72
73 void* operator new( size_t n, IgHookTraceAlloc* alloc = 0 );
74
75 // Class methods
76 IgHookTrace( IgHookTrace* parent = 0, void* address = 0 );
77
78 IgHookTrace* parent( void );
79 IgHookTrace* next( void );
80
81 void* address( void );
82 bool symbol( const char*& sym, const char*& lib, int& offset, int& liboffset );
83
84 IgHookTrace* children( void );
85 IgHookTrace* child( void* address );
86
87 CounterValue* counters( void );
88 CounterValue* counter( Counter* id );
89
90 void merge( IgHookTrace* other );
91
92 private:
93 IgHookTraceAlloc* m_alloc;
94 IgHookTrace* m_parent;
95 IgHookTrace* m_next;
96 IgHookTrace* m_children;
97 void* m_address;
98 CounterValue* m_counters;
99 };
100
101 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
102 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
103
104 #endif // IG_HOOK_IG_HOOK_TRACE_H
IgHookTraceAlloc::m_left
size_t m_left
Definition: IgHook_IgHookTrace.h:25
IgHookTrace::CounterValue::m_next
CounterValue * m_next
Definition: IgHook_IgHookTrace.h:63
IgHookTrace::CounterValue::m_counter
Counter * m_counter
Definition: IgHook_IgHookTrace.h:62
IgHookTrace
Definition: IgHook_IgHookTrace.h:28
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:228
IgHookTrace::m_children
IgHookTrace * m_children
Definition: IgHook_IgHookTrace.h:96
IgHookTrace::m_parent
IgHookTrace * m_parent
Definition: IgHook_IgHookTrace.h:94
GaudiPython.Persistency.add
def add(instance)
Definition: Persistency.py:39
IgHookTrace::CounterValue
Value for a counter chained from a trace.
Definition: IgHook_IgHookTrace.h:37
IgHookTrace::CounterValue::m_value
unsigned long long m_value
Definition: IgHook_IgHookTrace.h:64
IgHookTrace::Counter
Nearly dummy object type to identify a counter.
Definition: IgHook_IgHookTrace.h:32
IgHookTrace::Counter::m_name
const char * m_name
Definition: IgHook_IgHookTrace.h:33
IgHookTrace::m_next
IgHookTrace * m_next
Definition: IgHook_IgHookTrace.h:95
plotSpeedupsPyRoot.counter
int counter
Definition: plotSpeedupsPyRoot.py:149
IgHookTrace::CounterValue::m_count
unsigned long long m_count
Definition: IgHook_IgHookTrace.h:65
IgHookTrace::m_counters
CounterValue * m_counters
Definition: IgHook_IgHookTrace.h:98
IgHookTrace::m_alloc
IgHookTraceAlloc * m_alloc
Definition: IgHook_IgHookTrace.h:93
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:97
IgHookTraceAlloc::IgHookTraceAlloc
IgHookTraceAlloc(void)
Definition: IgHook_IgHookTrace.cpp:99
IgHookTraceAlloc
Definition: IgHook_IgHookTrace.h:16
IgHookTraceAlloc::m_pool
void * m_pool
Definition: IgHook_IgHookTrace.h:24
IgHookTraceAlloc::allocate
void * allocate(size_t bytes)
Definition: IgHook_IgHookTrace.cpp:101