libstdc++
__gnu_profile Namespace Reference

Classes

class  __container_size_info
 
class  __container_size_stack_info
 
class  __hashfunc_info
 
class  __hashfunc_stack_info
 
class  __list2vector_info
 
class  __map2umap_info
 
class  __map2umap_stack_info
 
class  __object_info_base
 
struct  __reentrance_guard
 
class  __stack_hash
 
class  __stack_info_base
 
class  __trace_base
 
class  __trace_container_size
 
class  __trace_hash_func
 
class  __trace_hashtable_size
 
class  __trace_map2umap
 
class  __trace_vector_size
 
class  __trace_vector_to_list
 
class  __vector2list_info
 
class  __vector2list_stack_info
 
struct  __warning_data
 

Typedefs

typedef std::::vector
< __cost_factor * > 
__cost_factor_vector
 
typedef std::::unordered_map
< std::string, std::string
__env_t
 
typedef void * __instruction_address_t
 
typedef const void * __object_t
 
typedef std::::vector
< __instruction_address_t > 
__stack_npt
 
typedef __stack_npt * __stack_t
 
typedef std::::vector
< __warning_data
__warning_vector_t
 

Enumerations

enum  __state_type { __ON, __OFF, __INVALID }
 

Functions

std::size_t __env_to_size_t (const char *__env_var, std::size_t __default_value)
 
template<typename _InputIterator , typename _Function >
_Function __for_each (_InputIterator __first, _InputIterator __last, _Function __f)
 
__stack_t __get_stack ()
 
template<typename _Container >
void __insert_top_n (_Container &__output, const typename _Container::value_type &__value, typename _Container::size_type __n)
 
bool __is_invalid ()
 
bool __is_off ()
 
bool __is_on ()
 
int __log2 (std::size_t __size)
 
int __log_magnitude (float __f)
 
float __map_erase_cost (std::size_t __size)
 
float __map_find_cost (std::size_t __size)
 
float __map_insert_cost (std::size_t __size)
 
std::size_t __max_mem ()
 
FILE * __open_output_file (const char *__extension)
 
bool __profcxx_init ()
 
void __profcxx_init_unconditional ()
 
void __read_cost_factors ()
 
template<typename _ForwardIterator , typename _Tp >
_ForwardIterator __remove (_ForwardIterator __first, _ForwardIterator __last, const _Tp &__value)
 
void __report (void)
 
void __set_cost_factors ()
 
void __set_max_mem ()
 
void __set_max_stack_trace_depth ()
 
void __set_max_warn_count ()
 
void __set_trace_path ()
 
std::size_t __size (__stack_t __stack)
 
std::size_t __stack_max_depth ()
 
template<typename _Container >
void __top_n (const _Container &__input, _Container &__output, typename _Container::size_type __n)
 
void __trace_hash_func_construct (const void *)
 
void __trace_hash_func_destruct (const void *, std::size_t, std::size_t, std::size_t)
 
void __trace_hash_func_init ()
 
void __trace_hash_func_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_hashtable_size_construct (const void *, std::size_t)
 
void __trace_hashtable_size_destruct (const void *, std::size_t, std::size_t)
 
void __trace_hashtable_size_init ()
 
void __trace_hashtable_size_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_hashtable_size_resize (const void *, std::size_t, std::size_t)
 
void __trace_list_to_set_construct (const void *)
 
void __trace_list_to_set_destruct (const void *)
 
void __trace_list_to_set_find (const void *, std::size_t)
 
void __trace_list_to_set_insert (const void *, std::size_t, std::size_t)
 
void __trace_list_to_set_invalid_operator (const void *)
 
void __trace_list_to_set_iterate (const void *, std::size_t)
 
void __trace_list_to_slist_construct (const void *)
 
void __trace_list_to_slist_destruct (const void *)
 
void __trace_list_to_slist_init ()
 
void __trace_list_to_slist_operation (const void *)
 
void __trace_list_to_slist_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_list_to_slist_rewind (const void *)
 
void __trace_list_to_vector_construct (const void *)
 
void __trace_list_to_vector_destruct (const void *)
 
void __trace_list_to_vector_init ()
 
void __trace_list_to_vector_insert (const void *, std::size_t, std::size_t)
 
void __trace_list_to_vector_invalid_operator (const void *)
 
void __trace_list_to_vector_iterate (const void *, std::size_t)
 
void __trace_list_to_vector_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_list_to_vector_resize (const void *, std::size_t, std::size_t)
 
void __trace_map_to_unordered_map_construct (const void *)
 
void __trace_map_to_unordered_map_destruct (const void *)
 
void __trace_map_to_unordered_map_erase (const void *, std::size_t, std::size_t)
 
void __trace_map_to_unordered_map_find (const void *, std::size_t)
 
void __trace_map_to_unordered_map_init ()
 
void __trace_map_to_unordered_map_insert (const void *, std::size_t, std::size_t)
 
void __trace_map_to_unordered_map_invalidate (const void *)
 
void __trace_map_to_unordered_map_iterate (const void *, std::size_t)
 
void __trace_map_to_unordered_map_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_vector_size_construct (const void *, std::size_t)
 
void __trace_vector_size_destruct (const void *, std::size_t, std::size_t)
 
void __trace_vector_size_init ()
 
void __trace_vector_size_report (FILE *, __warning_vector_t &)
 
void __trace_vector_size_resize (const void *, std::size_t, std::size_t)
 
void __trace_vector_to_list_construct (const void *)
 
void __trace_vector_to_list_destruct (const void *)
 
void __trace_vector_to_list_find (const void *, std::size_t)
 
void __trace_vector_to_list_init ()
 
void __trace_vector_to_list_insert (const void *, std::size_t, std::size_t)
 
void __trace_vector_to_list_invalid_operator (const void *)
 
void __trace_vector_to_list_iterate (const void *, std::size_t)
 
void __trace_vector_to_list_report (FILE *, __warning_vector_t &)
 
void __trace_vector_to_list_resize (const void *, std::size_t, std::size_t)
 
bool __turn (__state_type __s)
 
bool __turn_off ()
 
bool __turn_on ()
 
void __write (FILE *__f, __stack_t __stack)
 
void __write_cost_factors ()
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__state_type, __state, __INVALID)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_hash_func *, _S_hash_func, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_hashtable_size *, _S_hashtable_size, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_map2umap *, _S_map2umap, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_vector_size *, _S_vector_size, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_vector_to_list *, _S_vector_to_list, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_list_to_slist *, _S_list_to_slist, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__trace_list_to_vector *, _S_list_to_vector, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __vector_shift_cost_factor,{"__vector_shift_cost_factor", 1.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __vector_iterate_cost_factor,{"__vector_iterate_cost_factor", 1.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __vector_resize_cost_factor,{"__vector_resize_cost_factor", 1.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __list_shift_cost_factor,{"__list_shift_cost_factor", 0.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __list_iterate_cost_factor,{"__list_iterate_cost_factor", 10.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __list_resize_cost_factor,{"__list_resize_cost_factor", 0.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __map_insert_cost_factor,{"__map_insert_cost_factor", 1.5})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __map_erase_cost_factor,{"__map_erase_cost_factor", 1.5})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __map_find_cost_factor,{"__map_find_cost_factor", 1})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __map_iterate_cost_factor,{"__map_iterate_cost_factor", 2.3})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __umap_insert_cost_factor,{"__umap_insert_cost_factor", 12.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __umap_erase_cost_factor,{"__umap_erase_cost_factor", 12.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __umap_find_cost_factor,{"__umap_find_cost_factor", 10.0})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor, __umap_iterate_cost_factor,{"__umap_iterate_cost_factor", 1.7})
 
 _GLIBCXX_PROFILE_DEFINE_DATA (__cost_factor_vector *, __cost_factors, 0)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (const char *, _S_trace_file_name, _GLIBCXX_PROFILE_TRACE_PATH_ROOT)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (std::size_t, _S_max_warn_count, _GLIBCXX_PROFILE_MAX_WARN_COUNT)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (std::size_t, _S_max_stack_depth, _GLIBCXX_PROFILE_MAX_STACK_DEPTH)
 
 _GLIBCXX_PROFILE_DEFINE_DATA (std::size_t, _S_max_mem, _GLIBCXX_PROFILE_MEM_PER_DIAGNOSTIC)
 
 _GLIBCXX_PROFILE_DEFINE_UNINIT_DATA (__env_t, __env)
 
 _GLIBCXX_PROFILE_DEFINE_UNINIT_DATA (__gnu_cxx::__mutex, __global_lock)
 

Detailed Description

GNU profile code for public use.

Typedef Documentation

typedef std:: ::unordered_map<std::string, std::string> __gnu_profile::__env_t

Internal environment. Values can be set one of two ways: 1. In config file "var = value". The default config file path is libstdcxx-profile.conf. 2. By setting process environment variables. For instance, in a Bash shell you can set the unit cost of iterating through a map like this: export __map_iterate_cost_factor=5.0. If a value is set both in the input file and through an environment variable, the environment value takes precedence.

Definition at line 65 of file profiler_trace.h.

Function Documentation

bool __gnu_profile::__profcxx_init ( )
inline

This function must be called by each instrumentation point.

The common path is inlined fully.

Definition at line 649 of file profiler_trace.h.

void __gnu_profile::__report ( void  )
inline

Final report method, registered with atexit.

This can also be called directly by user code, including signal handlers. It is protected against deadlocks by the reentrance guard in profiler.h. However, when called from a signal handler that triggers while within __gnu_profile (under the guarded zone), no output will be produced.

Definition at line 440 of file profiler_trace.h.

References std::min().

__gnu_profile::_GLIBCXX_PROFILE_DEFINE_UNINIT_DATA ( __gnu_cxx::__mutex  ,
__global_lock   
)

Master lock.