| The Gaudi Framework v27r1

- 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 <new>
7 # include <cstddef>
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 { const char *m_name; };
33
35 class CounterValue
36 {
37 public:
38 void * operator new (size_t n, IgHookTraceAlloc *alloc = 0);
39
40 CounterValue (Counter *counter,
41 CounterValue *next = 0,
42 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,
72 const char *&lib, int &offset,
73 int &liboffset);
74
75 void * operator new (size_t n, IgHookTraceAlloc *alloc = 0);
76
77 // Class methods
78 IgHookTrace (IgHookTrace *parent = 0, void *address = 0);
79
80 IgHookTrace * parent (void);
81 IgHookTrace * next (void);
82
83 void * address (void);
84 bool symbol (const char *&sym, const char *&lib,
85 int &offset, int &liboffset);
86
87 IgHookTrace * children (void);
88 IgHookTrace * child (void *address);
89
90 CounterValue * counters (void);
91 CounterValue * counter (Counter *id);
92
93 void merge (IgHookTrace *other);
94
95 private:
96 IgHookTraceAlloc *m_alloc;
97 IgHookTrace *m_parent;
98 IgHookTrace *m_next;
99 IgHookTrace *m_children;
100 void *m_address;
101 CounterValue *m_counters;
102 };
103
104 //<<<<<< INLINE PUBLIC FUNCTIONS >>>>>>
105 //<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
106
107 #endif // IG_HOOK_IG_HOOK_TRACE_H
IgHookTrace::CounterValue::next
CounterValue * next(void)
Definition: IgHook_IgHookTrace.cpp:155
IgHookTrace::tosymbol
static void * tosymbol(void *address)
Definition: IgHook_IgHookTrace.cpp:263
IgHookTraceAlloc::m_left
size_t m_left
Definition: IgHook_IgHookTrace.h:25
IgHookTrace::parent
IgHookTrace * parent(void)
Definition: IgHook_IgHookTrace.cpp:215
IgHookTrace::CounterValue::untick
unsigned long long untick(void)
Definition: IgHook_IgHookTrace.cpp:171
IgHookTrace::CounterValue::m_next
CounterValue * m_next
Definition: IgHook_IgHookTrace.h:63
IgHookTrace::CounterValue::m_counter
Counter * m_counter
Definition: IgHook_IgHookTrace.h:62
GaudiPluginService.cpluginsvc.n
list n
Definition: cpluginsvc.py:217
IgHookTrace::counter
CounterValue * counter(Counter *id)
IgHookTrace
Definition: IgHook_IgHookTrace.h:28
IgHookTrace::m_children
IgHookTrace * m_children
Definition: IgHook_IgHookTrace.h:99
IgHookTrace::CounterValue::add
unsigned long long add(unsigned long long value)
Definition: IgHook_IgHookTrace.cpp:175
IgHookTrace::m_parent
IgHookTrace * m_parent
Definition: IgHook_IgHookTrace.h:97
IgHookTrace::child
IgHookTrace * child(void *address)
IgHookTrace::CounterValue::counter
Counter * counter(void)
Definition: IgHook_IgHookTrace.cpp:151
IgHookTrace::children
IgHookTrace * children(void)
IgHookTrace::CounterValue::tick
unsigned long long tick(void)
Definition: IgHook_IgHookTrace.cpp:167
IgHookTrace::address
void * address(void)
Definition: IgHook_IgHookTrace.cpp:223
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:227
IgHookTrace::CounterValue::max
unsigned long long max(unsigned long long value)
Definition: IgHook_IgHookTrace.cpp:183
IgHookTrace::CounterValue::value
unsigned long long value(void)
Definition: IgHook_IgHookTrace.cpp:159
IgHookTrace::CounterValue::m_value
unsigned long long m_value
Definition: IgHook_IgHookTrace.h:64
IgHookTrace::CounterValue::sub
unsigned long long sub(unsigned long long value)
Definition: IgHook_IgHookTrace.cpp:179
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:32
IgHookTrace::m_next
IgHookTrace * m_next
Definition: IgHook_IgHookTrace.h:98
IgHookTrace::CounterValue::CounterValue
CounterValue(Counter *counter, CounterValue *next=0, unsigned long long value=0)
Definition: IgHook_IgHookTrace.cpp:141
IgHookTrace::CounterValue::m_count
unsigned long long m_count
Definition: IgHook_IgHookTrace.h:65
IgHookTrace::m_counters
CounterValue * m_counters
Definition: IgHook_IgHookTrace.h:101
IgHookTrace::merge
void merge(IgHookTrace *other)
IgHookTrace::m_alloc
IgHookTraceAlloc * m_alloc
Definition: IgHook_IgHookTrace.h:96
IgHookTrace::m_address
void * m_address
Definition: IgHook_IgHookTrace.h:100
IgHookTrace::CounterValue::count
unsigned long long count(void)
Definition: IgHook_IgHookTrace.cpp:163
IgHookTrace::IgHookTrace
IgHookTrace(IgHookTrace *parent=0, void *address=0)
Definition: IgHook_IgHookTrace.cpp:205
IgHookTraceAlloc::IgHookTraceAlloc
IgHookTraceAlloc(void)
Definition: IgHook_IgHookTrace.cpp:99
IgHookTraceAlloc
Definition: IgHook_IgHookTrace.h:16
IgHookTrace::next
IgHookTrace * next(void)
Definition: IgHook_IgHookTrace.cpp:219
IgHookTraceAlloc::m_pool
void * m_pool
Definition: IgHook_IgHookTrace.h:24
IgHookTraceAlloc::allocate
void * allocate(size_t bytes)
Definition: IgHook_IgHookTrace.cpp:105