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  __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 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 __report_and_free ()
 
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)
 
__hashfunc_info__trace_hash_func_construct ()
 
void __trace_hash_func_destruct (__hashfunc_info *, std::size_t, std::size_t, std::size_t)
 
void __trace_hash_func_free ()
 
void __trace_hash_func_init ()
 
void __trace_hash_func_report (FILE *__f, __warning_vector_t &__warnings)
 
__container_size_info__trace_hashtable_size_construct (std::size_t)
 
void __trace_hashtable_size_destruct (__container_size_info *, std::size_t, std::size_t)
 
void __trace_hashtable_size_free ()
 
void __trace_hashtable_size_init ()
 
void __trace_hashtable_size_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_hashtable_size_resize (__container_size_info *, std::size_t, std::size_t)
 
__list2slist_info * __trace_list_to_slist_construct ()
 
void __trace_list_to_slist_destruct (__list2slist_info *)
 
void __trace_list_to_slist_free ()
 
void __trace_list_to_slist_init ()
 
void __trace_list_to_slist_operation (__list2slist_info *)
 
void __trace_list_to_slist_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_list_to_slist_rewind (__list2slist_info *)
 
__list2vector_info__trace_list_to_vector_construct ()
 
void __trace_list_to_vector_destruct (__list2vector_info *)
 
void __trace_list_to_vector_free ()
 
void __trace_list_to_vector_init ()
 
void __trace_list_to_vector_insert (__list2vector_info *, std::size_t, std::size_t)
 
void __trace_list_to_vector_invalid_operator (__list2vector_info *)
 
void __trace_list_to_vector_iterate (__list2vector_info *, int)
 
void __trace_list_to_vector_report (FILE *__f, __warning_vector_t &__warnings)
 
void __trace_list_to_vector_resize (__list2vector_info *, std::size_t, std::size_t)
 
__map2umap_info__trace_map_to_unordered_map_construct ()
 
void __trace_map_to_unordered_map_destruct (__map2umap_info *)
 
void __trace_map_to_unordered_map_erase (__map2umap_info *, std::size_t, std::size_t)
 
void __trace_map_to_unordered_map_find (__map2umap_info *, std::size_t)
 
void __trace_map_to_unordered_map_free ()
 
void __trace_map_to_unordered_map_init ()
 
void __trace_map_to_unordered_map_insert (__map2umap_info *, std::size_t, std::size_t)
 
void __trace_map_to_unordered_map_invalidate (__map2umap_info *)
 
void __trace_map_to_unordered_map_iterate (__map2umap_info *, std::size_t)
 
void __trace_map_to_unordered_map_iterate (__map2umap_info *__info, int)
 
void __trace_map_to_unordered_map_report (FILE *__f, __warning_vector_t &__warnings)
 
template<typename __object_info , typename __stack_info >
void __trace_report (__trace_base< __object_info, __stack_info > *__cont, FILE *__f, __warning_vector_t &__warnings)
 
__container_size_info__trace_vector_size_construct (std::size_t)
 
void __trace_vector_size_destruct (__container_size_info *, std::size_t, std::size_t)
 
void __trace_vector_size_free ()
 
void __trace_vector_size_init ()
 
void __trace_vector_size_report (FILE *, __warning_vector_t &)
 
void __trace_vector_size_resize (__container_size_info *, std::size_t, std::size_t)
 
__vector2list_info__trace_vector_to_list_construct ()
 
void __trace_vector_to_list_destruct (__vector2list_info *)
 
void __trace_vector_to_list_free ()
 
void __trace_vector_to_list_init ()
 
void __trace_vector_to_list_insert (__vector2list_info *, std::size_t, std::size_t)
 
void __trace_vector_to_list_invalid_operator (__vector2list_info *)
 
void __trace_vector_to_list_iterate (__vector2list_info *, int)
 
void __trace_vector_to_list_report (FILE *, __warning_vector_t &)
 
void __trace_vector_to_list_resize (__vector2list_info *, 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_mutex)
 

Detailed Description

GNU profile code for public use.

Typedef Documentation

◆ __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

◆ __profcxx_init()

bool __gnu_profile::__profcxx_init ( )
inline

This function must be called by each instrumentation point.

The common path is inlined fully.

Definition at line 653 of file profiler_trace.h.

◆ __report()

void __gnu_profile::__report ( )
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 448 of file profiler_trace.h.

◆ _GLIBCXX_PROFILE_DEFINE_UNINIT_DATA()

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

Master lock.