30#ifndef _GLIBCXX_PROFILE_PROFILER_H
31#define _GLIBCXX_PROFILE_PROFILER_H 1
36#define _GLIBCXX_PROFILE_DEFINE_UNINIT_DATA(__type, __name) \
40 static __type __name; \
43#define _GLIBCXX_PROFILE_DEFINE_DATA(__type, __name, __initial_value...) \
44 inline __type& __get_##__name() { \
45 static __type __name(__initial_value); \
48#define _GLIBCXX_PROFILE_DATA(__name) \
63 if (__inside() ==
true)
75 static __thread
bool _S_inside(
false);
90 class __list2slist_info;
101 __trace_hashtable_size_construct(std::size_t);
103 std::size_t, std::size_t);
105 std::size_t, std::size_t);
108 __trace_hash_func_construct();
110 std::size_t, std::size_t, std::size_t);
113 __trace_vector_size_construct(std::size_t);
115 std::size_t, std::size_t);
117 std::size_t, std::size_t);
120 __trace_vector_to_list_construct();
122 std::size_t, std::size_t);
126 std::size_t, std::size_t);
130 __trace_list_to_slist_construct();
131 void __trace_list_to_slist_rewind(__list2slist_info*);
132 void __trace_list_to_slist_operation(__list2slist_info*);
133 void __trace_list_to_slist_destruct(__list2slist_info*);
136 __trace_list_to_vector_construct();
138 std::size_t, std::size_t);
142 std::size_t, std::size_t);
146 __trace_map_to_unordered_map_construct();
148 void __trace_map_to_unordered_map_insert(
__map2umap_info*, std::size_t,
152 void __trace_map_to_unordered_map_iterate(
__map2umap_info*, std::size_t);
158#ifdef _GLIBCXX_PROFILE
159#ifndef _GLIBCXX_PROFILE_NO_HASHTABLE_TOO_SMALL
160#define _GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL
162#ifndef _GLIBCXX_PROFILE_NO_HASHTABLE_TOO_LARGE
163#define _GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE
165#ifndef _GLIBCXX_PROFILE_NO_VECTOR_TOO_SMALL
166#define _GLIBCXX_PROFILE_VECTOR_TOO_SMALL
168#ifndef _GLIBCXX_PROFILE_NO_VECTOR_TOO_LARGE
169#define _GLIBCXX_PROFILE_VECTOR_TOO_LARGE
171#ifndef _GLIBCXX_PROFILE_NO_INEFFICIENT_HASH
172#define _GLIBCXX_PROFILE_INEFFICIENT_HASH
174#ifndef _GLIBCXX_PROFILE_NO_VECTOR_TO_LIST
175#define _GLIBCXX_PROFILE_VECTOR_TO_LIST
177#ifndef _GLIBCXX_PROFILE_NO_LIST_TO_SLIST
178#define _GLIBCXX_PROFILE_LIST_TO_SLIST
180#ifndef _GLIBCXX_PROFILE_NO_LIST_TO_VECTOR
181#define _GLIBCXX_PROFILE_LIST_TO_VECTOR
183#ifndef _GLIBCXX_PROFILE_NO_MAP_TO_UNORDERED_MAP
184#define _GLIBCXX_PROFILE_MAP_TO_UNORDERED_MAP
189#ifdef _GLIBCXX_PROFILE
190#define __profcxx_report() __gnu_profile::__report()
191#define __profcxx_turn_on() __gnu_profile::__turn_on()
192#define __profcxx_turn_off() __gnu_profile::__turn_off()
193#define __profcxx_is_invalid() __gnu_profile::__is_invalid()
194#define __profcxx_is_on() __gnu_profile::__is_on()
195#define __profcxx_is_off() __gnu_profile::__is_off()
197#define __profcxx_report()
198#define __profcxx_turn_on()
199#define __profcxx_turn_off()
200#define __profcxx_is_invalid()
201#define __profcxx_is_on()
202#define __profcxx_is_off()
206#if (defined(_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL) \
207 || defined(_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE))
208#define __profcxx_hashtable_size_construct(__x...) \
209 __gnu_profile::__trace_hashtable_size_construct(__x)
210#define __profcxx_hashtable_size_resize(__x...) \
211 __gnu_profile::__trace_hashtable_size_resize(__x)
212#define __profcxx_hashtable_size_destruct(__x...) \
213 __gnu_profile::__trace_hashtable_size_destruct(__x)
215#define __profcxx_hashtable_size_construct(__x...) 0
216#define __profcxx_hashtable_size_resize(__x...)
217#define __profcxx_hashtable_size_destruct(__x...)
221#if (defined(_GLIBCXX_PROFILE_VECTOR_TOO_SMALL) \
222 || defined(_GLIBCXX_PROFILE_VECTOR_TOO_LARGE))
223#define __profcxx_vector_size_construct(__x...) \
224 __gnu_profile::__trace_vector_size_construct(__x)
225#define __profcxx_vector_size_resize(__x...) \
226 __gnu_profile::__trace_vector_size_resize(__x)
227#define __profcxx_vector_size_destruct(__x...) \
228 __gnu_profile::__trace_vector_size_destruct(__x)
230#define __profcxx_vector_size_construct(__x...) 0
231#define __profcxx_vector_size_resize(__x...)
232#define __profcxx_vector_size_destruct(__x...)
236#if defined(_GLIBCXX_PROFILE_INEFFICIENT_HASH)
237#define __profcxx_hash_func_construct(__x...) \
238 __gnu_profile::__trace_hash_func_construct(__x)
239#define __profcxx_hash_func_destruct(__x...) \
240 __gnu_profile::__trace_hash_func_destruct(__x)
242#define __profcxx_hash_func_construct(__x...) 0
243#define __profcxx_hash_func_destruct(__x...)
247#if defined(_GLIBCXX_PROFILE_VECTOR_TO_LIST)
248#define __profcxx_vector2list_construct(__x...) \
249 __gnu_profile::__trace_vector_to_list_construct(__x)
250#define __profcxx_vector2list_insert(__x...) \
251 __gnu_profile::__trace_vector_to_list_insert(__x)
252#define __profcxx_vector2list_iterate(__x...) \
253 __gnu_profile::__trace_vector_to_list_iterate(__x)
254#define __profcxx_vector2list_invalid_operator(__x...) \
255 __gnu_profile::__trace_vector_to_list_invalid_operator(__x)
256#define __profcxx_vector2list_resize(__x...) \
257 __gnu_profile::__trace_vector_to_list_resize(__x)
258#define __profcxx_vector2list_destruct(__x...) \
259 __gnu_profile::__trace_vector_to_list_destruct(__x)
261#define __profcxx_vector2list_construct(__x...) 0
262#define __profcxx_vector2list_insert(__x...)
263#define __profcxx_vector2list_iterate(__x...)
264#define __profcxx_vector2list_invalid_operator(__x...)
265#define __profcxx_vector2list_resize(__x...)
266#define __profcxx_vector2list_destruct(__x...)
270#if defined(_GLIBCXX_PROFILE_LIST_TO_VECTOR)
271#define __profcxx_list2vector_construct(__x...) \
272 __gnu_profile::__trace_list_to_vector_construct(__x)
273#define __profcxx_list2vector_insert(__x...) \
274 __gnu_profile::__trace_list_to_vector_insert(__x)
275#define __profcxx_list2vector_iterate(__x...) \
276 __gnu_profile::__trace_list_to_vector_iterate(__x)
277#define __profcxx_list2vector_invalid_operator(__x...) \
278 __gnu_profile::__trace_list_to_vector_invalid_operator(__x)
279#define __profcxx_list2vector_destruct(__x...) \
280 __gnu_profile::__trace_list_to_vector_destruct(__x)
282#define __profcxx_list2vector_construct(__x...) 0
283#define __profcxx_list2vector_insert(__x...)
284#define __profcxx_list2vector_iterate(__x...)
285#define __profcxx_list2vector_invalid_operator(__x...)
286#define __profcxx_list2vector_destruct(__x...)
290#if defined(_GLIBCXX_PROFILE_LIST_TO_SLIST)
291#define __profcxx_list2slist_construct(__x...) \
292 __gnu_profile::__trace_list_to_slist_construct(__x)
293#define __profcxx_list2slist_rewind(__x...) \
294 __gnu_profile::__trace_list_to_slist_rewind(__x)
295#define __profcxx_list2slist_operation(__x...) \
296 __gnu_profile::__trace_list_to_slist_operation(__x)
297#define __profcxx_list2slist_destruct(__x...) \
298 __gnu_profile::__trace_list_to_slist_destruct(__x)
300#define __profcxx_list2slist_construct(__x...) 0
301#define __profcxx_list2slist_rewind(__x...)
302#define __profcxx_list2slist_operation(__x...)
303#define __profcxx_list2slist_destruct(__x...)
307#if defined(_GLIBCXX_PROFILE_MAP_TO_UNORDERED_MAP)
308#define __profcxx_map2umap_construct(__x...) \
309 __gnu_profile::__trace_map_to_unordered_map_construct(__x)
310#define __profcxx_map2umap_insert(__x...) \
311 __gnu_profile::__trace_map_to_unordered_map_insert(__x)
312#define __profcxx_map2umap_erase(__x...) \
313 __gnu_profile::__trace_map_to_unordered_map_erase(__x)
314#define __profcxx_map2umap_iterate(__x...) \
315 __gnu_profile::__trace_map_to_unordered_map_iterate(__x)
316#define __profcxx_map2umap_invalidate(__x...) \
317 __gnu_profile::__trace_map_to_unordered_map_invalidate(__x)
318#define __profcxx_map2umap_find(__x...) \
319 __gnu_profile::__trace_map_to_unordered_map_find(__x)
320#define __profcxx_map2umap_destruct(__x...) \
321 __gnu_profile::__trace_map_to_unordered_map_destruct(__x)
323#define __profcxx_map2umap_construct(__x...) 0
324#define __profcxx_map2umap_insert(__x...)
325#define __profcxx_map2umap_erase(__x...)
326#define __profcxx_map2umap_iterate(__x...)
327#define __profcxx_map2umap_invalidate(__x...)
328#define __profcxx_map2umap_find(__x...)
329#define __profcxx_map2umap_destruct(__x...)
333#ifndef _GLIBCXX_PROFILE_TRACE_PATH_ROOT
334#define _GLIBCXX_PROFILE_TRACE_PATH_ROOT "libstdcxx-profile"
336#ifndef _GLIBCXX_PROFILE_TRACE_ENV_VAR
337#define _GLIBCXX_PROFILE_TRACE_ENV_VAR "_GLIBCXX_PROFILE_TRACE_PATH_ROOT"
339#ifndef _GLIBCXX_PROFILE_MAX_WARN_COUNT_ENV_VAR
340#define _GLIBCXX_PROFILE_MAX_WARN_COUNT_ENV_VAR \
341 "_GLIBCXX_PROFILE_MAX_WARN_COUNT"
343#ifndef _GLIBCXX_PROFILE_MAX_WARN_COUNT
344#define _GLIBCXX_PROFILE_MAX_WARN_COUNT 10
346#ifndef _GLIBCXX_PROFILE_MAX_STACK_DEPTH
347#define _GLIBCXX_PROFILE_MAX_STACK_DEPTH 32
349#ifndef _GLIBCXX_PROFILE_MAX_STACK_DEPTH_ENV_VAR
350#define _GLIBCXX_PROFILE_MAX_STACK_DEPTH_ENV_VAR \
351 "_GLIBCXX_PROFILE_MAX_STACK_DEPTH"
353#ifndef _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC
354#define _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC (1 << 28)
356#ifndef _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC_ENV_VAR
357#define _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC_ENV_VAR \
358 "_GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC"
diagnostics for list to vector.
Collection of hashtable size traces.
Data structures to represent profiling traces.
diagnostics for vector to list.
Diagnostics for map to unordered_map.
Diagnostics for list to slist.
Collection of vector size traces.
GNU profile code for public use.
void __report()
Final report method, registered with atexit.
A container size instrumentation line in the object table.
A hash performance instrumentation line in the object table.
A list-to-vector instrumentation line in the object table.
A map-to-unordered_map instrumentation line in the object table.
A vector-to-list instrumentation line in the object table.