# __gnu_profile Namespace Reference

GNU profile code for public use. More...

## Classes

- class __container_size_info
    A container size instrumentation line in the object table. More...
- class __container_size_stack_info
    A container size instrumentation line in the stack table. More...
- class __hashfunc_info
    A hash performance instrumentation line in the object table. More...
- class __hashfunc_stack_info
    A hash performance instrumentation line in the stack table. More...
- class __list2vector_info
    A list-to-vector instrumentation line in the object table. More...
- class __map2umap_info
    A map-to-unordered_map instrumentation line in the object table. More...
- class __map2umap_stack_info
    A map-to-unordered_map instrumentation line in the stack table. More...
- class __object_info_base
    Base class for a line in the object table. More...
- struct __reentrance_guard
    Reentrance guard. More...
- class __stack_hash
    Hash function for summary trace using call stack as index. More...
- class __stack_info_base
    Base class for a line in the stack table. More...
- class __trace_base
    Base class for all trace producers. More...
- class __trace_container_size
    Container size instrumentation trace producer. More...
- class __trace_hash_func
    Hash performance instrumentation producer. More...
- class __trace_hashtable_size
    Hashtable size instrumentation trace producer. More...
- class __trace_map2umap
    Map-to-unordered_map instrumentation producer. More...
- class __trace_vector_size
    Hashtable size instrumentation trace producer. More...
- class __trace_vector_to_list
    Vector-to-list instrumentation producer. More...
- class __vector2list_info
    A vector-to-list instrumentation line in the object table. More...
- class __vector2list_stack_info
    A vector-to-list instrumentation line in the stack table. More...
- struct __warning_data
    Representation of a warning. More...

## Typedefs

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

## Enumerations

- enum __state_type { __ON, __OFF, __INVALID }

## Functions

- size_t __env_to_size_t (const char *__env_var, size_t __default_value)
- __cost_factor_vector *& __get___cost_factors ()
- __env_t & __get___env ()
- __gnu_cxx::__mutex & __get___global_lock ()
- __cost_factor & __get___list_iterate_cost_factor ()
- __cost_factor & __get___list_resize_cost_factor ()
- __cost_factor & __get___list_shift_cost_factor ()
- __cost_factor & __get___map_erase_cost_factor ()
- __cost_factor & __get___map_find_cost_factor ()
- __cost_factor & __get___map_insert_cost_factor ()
- __cost_factor & __get___map_iterate_cost_factor ()
- __cost_factor & __get___umap_erase_cost_factor ()
- __cost_factor & __get___umap_find_cost_factor ()
- __cost_factor & __get___umap_insert_cost_factor ()
- __cost_factor & __get___umap_iterate_cost_factor ()
- __cost_factor & __get___vector_iterate_cost_factor ()
- __cost_factor & __get___vector_resize_cost_factor ()
- __cost_factor & __get___vector_shift_cost_factor ()
- __trace_hash_func *& __get__S_hash_func ()
- __trace_hashtable_size *& __get__S_hashtable_size ()
- __trace_list_to_slist *& __get__S_list_to_slist ()
- __trace_list_to_vector *& __get__S_list_to_vector ()
- __trace_map2umap *& __get__S_map2umap ()
- size_t & __get__S_max_mem ()
- size_t & __get__S_max_stack_depth ()
- size_t & __get__S_max_warn_count ()
- const char *& __get__S_trace_file_name ()
- __trace_vector_size *& __get__S_vector_size ()
- __trace_vector_to_list *& __get__S_vector_to_list ()
- __stack_t __get_stack ()
- bool __is_invalid ()
- bool __is_off ()
- bool __is_on ()
- int __log2 (size_t __size)
- int __log_magnitude (float __f)
- float __map_erase_cost (size_t __size)
- float __map_find_cost (size_t __size)
- float __map_insert_cost (size_t __size)
- size_t __max_mem ()
- FILE * __open_output_file (const char *__extension)
- bool __profcxx_init (void)
- void __profcxx_init_unconditional ()
- void __read_cost_factors ()
- 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 ()
- __size (const __stack_t &__stack)
- size_t __stack_max_depth ()
- void __trace_hash_func_construct (const void *)
- void __trace_hash_func_destruct (const void *, size_t, size_t, 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 *, size_t)
- void __trace_hashtable_size_destruct (const void *, size_t, 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 *, size_t, 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 *, size_t)
- void __trace_list_to_set_insert (const void *, size_t, size_t)
- void __trace_list_to_set_invalid_operator (const void *)
- void __trace_list_to_set_iterate (const void *, 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 *, size_t, size_t)
- void __trace_list_to_vector_invalid_operator (const void *)
- void __trace_list_to_vector_iterate (const void *, size_t)
- void __trace_list_to_vector_report (FILE *__f, __warning_vector_t &__warnings)
- void __trace_list_to_vector_resize (const void *, size_t, 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 *, size_t, size_t)
- void __trace_map_to_unordered_map_find (const void *, size_t)
- void __trace_map_to_unordered_map_init ()
- void __trace_map_to_unordered_map_insert (const void *, size_t, size_t)
- void __trace_map_to_unordered_map_invalidate (const void *)
- void __trace_map_to_unordered_map_iterate (const void *, size_t)
- void __trace_map_to_unordered_map_report (FILE *__f, __warning_vector_t &__warnings)
- void __trace_vector_size_construct (const void *, size_t)
- void __trace_vector_size_destruct (const void *, size_t, size_t)
- void __trace_vector_size_init ()
- void __trace_vector_size_report (FILE *, __warning_vector_t &)
- void __trace_vector_size_resize (const void *, size_t, 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 *, size_t)
- void __trace_vector_to_list_init ()
- void __trace_vector_to_list_insert (const void *, size_t, size_t)
- void __trace_vector_to_list_invalid_operator (const void *)
- void __trace_vector_to_list_iterate (const void *, size_t)
- void __trace_vector_to_list_report (FILE *, __warning_vector_t &)
- void __trace_vector_to_list_resize (const void *, size_t, size_t)
- bool __turn (__state_type __s)
- bool __turn_off ()
- bool __turn_on ()
- void __write (FILE *__f, const __stack_t __stack)
- void __write_cost_factors ()
- _GLIBCXX_PROFILE_DEFINE_DATA (__state_type, __state, __INVALID)

## Detailed Description

GNU profile code for public use.

## Typedef Documentation

typedef std:: 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 75 of file profiler_trace.h.

## Function Documentation

__gnu_cxx::__mutex& __gnu_profile::__get___global_lock | ( |  | ) | `[inline]`

Master lock.

Definition at line 79 of file profiler_trace.h.

bool __gnu_profile::__profcxx_init | ( | void |  | ) | `[inline]`

This function must be called by each instrumentation point.

The common path is inlined fully.

Definition at line 617 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 398 of file profiler_trace.h.

References std::min().