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) \ 
   51 namespace __gnu_profile
 
   63       if (__inside() == 
true)
 
   75       static __thread 
bool _S_inside(
false);
 
   83 #define _GLIBCXX_PROFILE_REENTRANCE_GUARD(__x...)           \ 
   85     if (__gnu_profile::__reentrance_guard::__get_in())          \ 
   87       __gnu_profile::__reentrance_guard __get_out;      \ 
  101   void __trace_hashtable_size_resize(
const void*, std::size_t, std::size_t);
 
  102   void __trace_hashtable_size_destruct(
const void*, std::size_t, std::size_t);
 
  103   void __trace_hashtable_size_construct(
const void*, std::size_t);
 
  104   void __trace_vector_size_resize(
const void*, std::size_t, std::size_t);
 
  105   void __trace_vector_size_destruct(
const void*, std::size_t, std::size_t);
 
  106   void __trace_vector_size_construct(
const void*, std::size_t);
 
  107   void __trace_hash_func_destruct(
const void*, std::size_t, std::size_t,
 
  109   void __trace_hash_func_construct(
const void*);
 
  110   void __trace_vector_to_list_destruct(
const void*);
 
  111   void __trace_vector_to_list_construct(
const void*);
 
  112   void __trace_vector_to_list_insert(
const void*, std::size_t, std::size_t);
 
  113   void __trace_vector_to_list_iterate(
const void*, std::size_t);
 
  114   void __trace_vector_to_list_invalid_operator(
const void*);
 
  115   void __trace_vector_to_list_resize(
const void*, std::size_t, std::size_t);
 
  116   void __trace_vector_to_list_find(
const void*, std::size_t);
 
  118   void __trace_list_to_slist_destruct(
const void*);
 
  119   void __trace_list_to_slist_construct(
const void*);
 
  120   void __trace_list_to_slist_rewind(
const void*);
 
  121   void __trace_list_to_slist_operation(
const void*);
 
  123   void __trace_list_to_vector_destruct(
const void*);
 
  124   void __trace_list_to_vector_construct(
const void*);
 
  125   void __trace_list_to_vector_insert(
const void*, std::size_t, std::size_t);
 
  126   void __trace_list_to_vector_iterate(
const void*, std::size_t);
 
  127   void __trace_list_to_vector_invalid_operator(
const void*);
 
  128   void __trace_list_to_vector_resize(
const void*, std::size_t, std::size_t);
 
  130   void __trace_list_to_set_destruct(
const void*);
 
  131   void __trace_list_to_set_construct(
const void*);
 
  132   void __trace_list_to_set_insert(
const void*, std::size_t, std::size_t); 
 
  133   void __trace_list_to_set_iterate(
const void*, std::size_t);
 
  134   void __trace_list_to_set_invalid_operator(
const void*);
 
  135   void __trace_list_to_set_find(
const void*, std::size_t); 
 
  137   void __trace_map_to_unordered_map_construct(
const void*);
 
  138   void __trace_map_to_unordered_map_invalidate(
const void*);
 
  139   void __trace_map_to_unordered_map_insert(
const void*, std::size_t,
 
  141   void __trace_map_to_unordered_map_erase(
const void*, std::size_t,
 
  143   void __trace_map_to_unordered_map_iterate(
const void*, std::size_t);
 
  144   void __trace_map_to_unordered_map_find(
const void*, std::size_t);
 
  145   void __trace_map_to_unordered_map_destruct(
const void*);
 
  149 #ifdef _GLIBCXX_PROFILE 
  150 #ifndef _GLIBCXX_PROFILE_NO_HASHTABLE_TOO_SMALL 
  151 #define _GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL 
  153 #ifndef _GLIBCXX_PROFILE_NO_HASHTABLE_TOO_LARGE 
  154 #define _GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE 
  156 #ifndef _GLIBCXX_PROFILE_NO_VECTOR_TOO_SMALL 
  157 #define _GLIBCXX_PROFILE_VECTOR_TOO_SMALL 
  159 #ifndef _GLIBCXX_PROFILE_NO_VECTOR_TOO_LARGE 
  160 #define _GLIBCXX_PROFILE_VECTOR_TOO_LARGE 
  162 #ifndef _GLIBCXX_PROFILE_NO_INEFFICIENT_HASH 
  163 #define _GLIBCXX_PROFILE_INEFFICIENT_HASH 
  165 #ifndef _GLIBCXX_PROFILE_NO_VECTOR_TO_LIST 
  166 #define _GLIBCXX_PROFILE_VECTOR_TO_LIST 
  168 #ifndef _GLIBCXX_PROFILE_NO_LIST_TO_SLIST 
  169 #define _GLIBCXX_PROFILE_LIST_TO_SLIST 
  171 #ifndef _GLIBCXX_PROFILE_NO_LIST_TO_VECTOR 
  172 #define _GLIBCXX_PROFILE_LIST_TO_VECTOR 
  174 #ifndef _GLIBCXX_PROFILE_NO_MAP_TO_UNORDERED_MAP 
  175 #define _GLIBCXX_PROFILE_MAP_TO_UNORDERED_MAP 
  180 #ifdef _GLIBCXX_PROFILE 
  181 #define __profcxx_report() \ 
  182   _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__report()) 
  183 #define __profcxx_turn_on() \ 
  184   _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__turn_on()) 
  185 #define __profcxx_turn_off() \ 
  186   _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__turn_off()) 
  187 #define __profcxx_is_invalid() \ 
  188   _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__is_invalid()) 
  189 #define __profcxx_is_on() \ 
  190   _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__is_on()) 
  191 #define __profcxx__is_off() \ 
  192   _GLIBCXX_PROFILE_REENTRANCE_GUARD(__gnu_profile::__is_off()) 
  194 #define __profcxx_report() 
  195 #define __profcxx_turn_on() 
  196 #define __profcxx_turn_off() 
  197 #define __profcxx_is_invalid() 
  198 #define __profcxx_is_on() 
  199 #define __profcxx_is_off() 
  203 #if (defined(_GLIBCXX_PROFILE_HASHTABLE_TOO_SMALL) \ 
  204      || defined(_GLIBCXX_PROFILE_HASHTABLE_TOO_LARGE)) 
  205 #define __profcxx_hashtable_resize(__x...) \ 
  206   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  207       __gnu_profile::__trace_hashtable_size_resize(__x)) 
  208 #define __profcxx_hashtable_destruct(__x...) \ 
  209   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  210       __gnu_profile::__trace_hashtable_size_destruct(__x)) 
  211 #define __profcxx_hashtable_construct(__x...) \ 
  212   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  213       __gnu_profile::__trace_hashtable_size_construct(__x)) 
  215 #define __profcxx_hashtable_resize(__x...)   
  216 #define __profcxx_hashtable_destruct(__x...)  
  217 #define __profcxx_hashtable_construct(__x...)   
  221 #if (defined(_GLIBCXX_PROFILE_VECTOR_TOO_SMALL) \ 
  222      || defined(_GLIBCXX_PROFILE_VECTOR_TOO_LARGE)) 
  223 #define __profcxx_vector_resize(__x...) \ 
  224   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  225       __gnu_profile::__trace_vector_size_resize(__x)) 
  226 #define __profcxx_vector_destruct(__x...) \ 
  227   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  228       __gnu_profile::__trace_vector_size_destruct(__x)) 
  229 #define __profcxx_vector_construct(__x...) \ 
  230   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  231       __gnu_profile::__trace_vector_size_construct(__x)) 
  233 #define __profcxx_vector_resize(__x...)   
  234 #define __profcxx_vector_destruct(__x...)  
  235 #define __profcxx_vector_construct(__x...)   
  239 #if defined(_GLIBCXX_PROFILE_INEFFICIENT_HASH) 
  240 #define __profcxx_hashtable_construct2(__x...) \ 
  241   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  242       __gnu_profile::__trace_hash_func_construct(__x)) 
  243 #define __profcxx_hashtable_destruct2(__x...) \ 
  244   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  245       __gnu_profile::__trace_hash_func_destruct(__x)) 
  247 #define __profcxx_hashtable_destruct2(__x...)  
  248 #define __profcxx_hashtable_construct2(__x...)   
  252 #if defined(_GLIBCXX_PROFILE_VECTOR_TO_LIST) 
  253 #define __profcxx_vector_construct2(__x...) \ 
  254   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  255       __gnu_profile::__trace_vector_to_list_construct(__x)) 
  256 #define __profcxx_vector_destruct2(__x...) \ 
  257   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  258       __gnu_profile::__trace_vector_to_list_destruct(__x)) 
  259 #define __profcxx_vector_insert(__x...) \ 
  260   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  261       __gnu_profile::__trace_vector_to_list_insert(__x)) 
  262 #define __profcxx_vector_iterate(__x...) \ 
  263   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  264       __gnu_profile::__trace_vector_to_list_iterate(__x)) 
  265 #define __profcxx_vector_invalid_operator(__x...) \ 
  266   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  267       __gnu_profile::__trace_vector_to_list_invalid_operator(__x)) 
  268 #define __profcxx_vector_resize2(__x...) \ 
  269   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  270       __gnu_profile::__trace_vector_to_list_resize(__x)) 
  271 #define __profcxx_vector_find(__x...) \ 
  272   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  273       __gnu_profile::__trace_vector_to_list_find(__x)) 
  275 #define __profcxx_vector_destruct2(__x...) 
  276 #define __profcxx_vector_construct2(__x...) 
  277 #define __profcxx_vector_insert(__x...) 
  278 #define __profcxx_vector_iterate(__x...) 
  279 #define __profcxx_vector_invalid_operator(__x...) 
  280 #define __profcxx_vector_resize2(__x...) 
  281 #define __profcxx_vector_find(__x...) 
  285 #if defined(_GLIBCXX_PROFILE_LIST_TO_VECTOR) 
  286 #define __profcxx_list_construct2(__x...) \ 
  287   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  288       __gnu_profile::__trace_list_to_vector_construct(__x)) 
  289 #define __profcxx_list_destruct2(__x...) \ 
  290   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  291       __gnu_profile::__trace_list_to_vector_destruct(__x)) 
  292 #define __profcxx_list_insert(__x...) \ 
  293   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  294       __gnu_profile::__trace_list_to_vector_insert(__x)) 
  295 #define __profcxx_list_iterate(__x...) \ 
  296   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  297       __gnu_profile::__trace_list_to_vector_iterate(__x)) 
  298 #define __profcxx_list_invalid_operator(__x...) \ 
  299   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  300       __gnu_profile::__trace_list_to_vector_invalid_operator(__x)) 
  302 #define __profcxx_list_destruct2(__x...) 
  303 #define __profcxx_list_construct2(__x...) 
  304 #define __profcxx_list_insert(__x...) 
  305 #define __profcxx_list_iterate(__x...) 
  306 #define __profcxx_list_invalid_operator(__x...) 
  310 #if defined(_GLIBCXX_PROFILE_LIST_TO_SLIST) 
  311 #define __profcxx_list_rewind(__x...) \ 
  312   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  313       __gnu_profile::__trace_list_to_slist_rewind(__x)) 
  314 #define __profcxx_list_operation(__x...) \ 
  315   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  316       __gnu_profile::__trace_list_to_slist_operation(__x)) 
  317 #define __profcxx_list_destruct(__x...) \ 
  318   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  319       __gnu_profile::__trace_list_to_slist_destruct(__x)) 
  320 #define __profcxx_list_construct(__x...) \ 
  321   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  322       __gnu_profile::__trace_list_to_slist_construct(__x)) 
  324 #define __profcxx_list_rewind(__x...)   
  325 #define __profcxx_list_operation(__x...) 
  326 #define __profcxx_list_destruct(__x...)  
  327 #define __profcxx_list_construct(__x...)   
  331 #if defined(_GLIBCXX_PROFILE_MAP_TO_UNORDERED_MAP) 
  332 #define __profcxx_map_to_unordered_map_construct(__x...) \ 
  333   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  334       __gnu_profile::__trace_map_to_unordered_map_construct(__x)) 
  335 #define __profcxx_map_to_unordered_map_destruct(__x...) \ 
  336   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  337       __gnu_profile::__trace_map_to_unordered_map_destruct(__x)) 
  338 #define __profcxx_map_to_unordered_map_insert(__x...) \ 
  339   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  340       __gnu_profile::__trace_map_to_unordered_map_insert(__x)) 
  341 #define __profcxx_map_to_unordered_map_erase(__x...) \ 
  342   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  343       __gnu_profile::__trace_map_to_unordered_map_erase(__x)) 
  344 #define __profcxx_map_to_unordered_map_iterate(__x...) \ 
  345   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  346       __gnu_profile::__trace_map_to_unordered_map_iterate(__x)) 
  347 #define __profcxx_map_to_unordered_map_invalidate(__x...) \ 
  348   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  349       __gnu_profile::__trace_map_to_unordered_map_invalidate(__x)) 
  350 #define __profcxx_map_to_unordered_map_find(__x...) \ 
  351   _GLIBCXX_PROFILE_REENTRANCE_GUARD( \ 
  352       __gnu_profile::__trace_map_to_unordered_map_find(__x)) 
  354 #define __profcxx_map_to_unordered_map_construct(__x...) \ 
  356 #define __profcxx_map_to_unordered_map_destruct(__x...) 
  357 #define __profcxx_map_to_unordered_map_insert(__x...) 
  358 #define __profcxx_map_to_unordered_map_erase(__x...) 
  359 #define __profcxx_map_to_unordered_map_iterate(__x...) 
  360 #define __profcxx_map_to_unordered_map_invalidate(__x...) 
  361 #define __profcxx_map_to_unordered_map_find(__x...) 
  365 #ifndef _GLIBCXX_PROFILE_TRACE_PATH_ROOT 
  366 #define _GLIBCXX_PROFILE_TRACE_PATH_ROOT "libstdcxx-profile" 
  368 #ifndef _GLIBCXX_PROFILE_TRACE_ENV_VAR 
  369 #define _GLIBCXX_PROFILE_TRACE_ENV_VAR "_GLIBCXX_PROFILE_TRACE_PATH_ROOT" 
  371 #ifndef _GLIBCXX_PROFILE_MAX_WARN_COUNT_ENV_VAR 
  372 #define _GLIBCXX_PROFILE_MAX_WARN_COUNT_ENV_VAR \ 
  373   "_GLIBCXX_PROFILE_MAX_WARN_COUNT" 
  375 #ifndef _GLIBCXX_PROFILE_MAX_WARN_COUNT 
  376 #define _GLIBCXX_PROFILE_MAX_WARN_COUNT 10 
  378 #ifndef _GLIBCXX_PROFILE_MAX_STACK_DEPTH 
  379 #define _GLIBCXX_PROFILE_MAX_STACK_DEPTH 32 
  381 #ifndef _GLIBCXX_PROFILE_MAX_STACK_DEPTH_ENV_VAR 
  382 #define _GLIBCXX_PROFILE_MAX_STACK_DEPTH_ENV_VAR \ 
  383   "_GLIBCXX_PROFILE_MAX_STACK_DEPTH" 
  385 #ifndef _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC 
  386 #define _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC (1 << 28) 
  388 #ifndef _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC_ENV_VAR 
  389 #define _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC_ENV_VAR \ 
  390   "_GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC" 
  402 #endif // _GLIBCXX_PROFILE_PROFILER_H