FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kProfileProbe.h
Go to the documentation of this file.
1 
8 #ifndef K_FIRESYNC_PROFILE_PROBE_H
9 #define K_FIRESYNC_PROFILE_PROBE_H
10 
11 #include <kFireSync/kNodeDef.h>
12 #include <kFireSync/kFsLib.h>
13 
21 typedef k64u kProfileContext;
22 
23 #include <kFireSync/Health/kProfileProbe.x.h>
24 
43 //typedef kObject kProfileProbe; --forward-declared in kFsDef.x.h
44 
55 {
56 # if defined(K_PROFILE)
57  {
58  return xkProfileProbe_ConstructImpl(probe, kFsLib_HealthProvider(), name, allocator);
59  }
60 # else
61  {
62  return xkProfileProbe_ConstructImpl(probe, kNULL, name, allocator);
63  }
64 # endif
65 }
66 
77 kInlineFx(kStatus) kProfileProbe_ConstructEx(kProfileProbe* probe, kHealth provider, const kChar* name, kAlloc allocator)
78 {
79 # if defined(K_PROFILE)
80  {
81  kHealth sanitizedProvider = !kIsNull(provider) ? provider : kFsLib_HealthProvider();
82 
83  return xkProfileProbe_ConstructImpl(probe, sanitizedProvider, name, allocator);
84  }
85 # else
86  {
87  return xkProfileProbe_ConstructImpl(probe, kNULL, name, allocator);
88  }
89 # endif
90 }
91 
99 {
100 # if defined(K_PROFILE)
101  {
102  xkProfileProbe_VTable(probe)->VStart(probe);
103  }
104 # endif
105 }
106 
114 {
115 # if defined(K_PROFILE)
116  {
117  xkProfileProbe_VTable(probe)->VStop(probe);
118  }
119 # endif
120 }
121 
134 {
135 # if defined(K_PROFILE)
136  {
137  xkProfileProbe_VTable(probe)->VStartEx(probe, context);
138  }
139 # endif
140 }
141 
150 {
151 # if defined(K_PROFILE)
152  {
153  xkProfileProbe_VTable(probe)->VStopEx(probe, context);
154  }
155 # endif
156 }
157 
166 {
167  kObj(kProfileProbe, probe);
168 
169  return obj->name;
170 }
171 
172 #endif
173 
174 
void kProfileProbe_StopEx(kProfileProbe probe, kProfileContext *context)
Ends a thread-safe code profiling measurement.
Definition: kProfileProbe.h:149
Context information for a code profiling measurement.
#define kIsNull(POINTER)
void kProfileProbe_StartEx(kProfileProbe probe, kProfileContext *context)
Begins a thread-safe code profiling measurement.
Definition: kProfileProbe.h:133
#define kInlineFx(TYPE)
const kChar * kProfileProbe_Name(kProfileProbe probe)
Reports the name of the profile probe.
Definition: kProfileProbe.h:165
Essential declarations related to FireSync nodes.
kHealth kFsLib_HealthProvider()
Gets the global health provider, if it exists.
Base class for a health statistics collection service.
#define kObj(TypeName_T, T_object)
Represents a code profiling probe.
void kProfileProbe_Start(kProfileProbe probe)
Begins a code profiling measurement.
Definition: kProfileProbe.h:98
kStatus kProfileProbe_ConstructEx(kProfileProbe *probe, kHealth provider, const kChar *name, kAlloc allocator)
Constructs a kProfileProbe object attached to the specified health provider.
Definition: kProfileProbe.h:77
void kProfileProbe_Stop(kProfileProbe probe)
Ends a code profiling measurement.
Definition: kProfileProbe.h:113
kStatus kProfileProbe_Construct(kProfileProbe *probe, const kChar *name, kAlloc allocator)
Constructs a kProfileProbe object attached to the default health provider.
Definition: kProfileProbe.h:54
#define kNULL