30 #ifndef _GLIBCXX_PROFILE_PROFILER_CONTAINER_SIZE_H
31 #define _GLIBCXX_PROFILE_PROFILER_CONTAINER_SIZE_H 1
39 namespace __gnu_profile
47 : _M_init(0), _M_max(0), _M_min(0), _M_total(0), _M_item_min(0),
48 _M_item_max(0), _M_item_total(0), _M_count(0), _M_resize(0), _M_cost(0)
53 _M_min(__o._M_min), _M_total(__o._M_total),
54 _M_item_min(__o._M_item_min), _M_item_max(__o._M_item_max),
55 _M_item_total(__o._M_item_total), _M_count(__o._M_count),
56 _M_resize(__o._M_resize), _M_cost(__o._M_cost)
61 _M_min(0), _M_total(0), _M_item_min(0), _M_item_max(0),
62 _M_item_total(0), _M_count(0), _M_resize(0), _M_cost(0)
68 __write(FILE* __f)
const
70 std::fprintf(__f,
"%Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu\n",
71 _M_init, _M_count, _M_cost, _M_resize, _M_min, _M_max,
72 _M_total, _M_item_min, _M_item_max, _M_item_total);
77 {
return static_cast<float>(_M_cost); }
83 if (_M_init < _M_item_max)
84 __message <<
"change initial container size from " << _M_init
85 <<
" to " << _M_item_max;
86 return __message.
str();
92 _M_init =
std::max(_M_init, __o._M_init);
93 _M_max =
std::max(_M_max, __o._M_max);
94 _M_item_max =
std::max(_M_item_max, __o._M_item_max);
95 _M_min =
std::min(_M_min, __o._M_min);
96 _M_item_min =
std::min(_M_item_min, __o._M_item_min);
97 _M_total += __o._M_total;
98 _M_item_total += __o._M_item_total;
99 _M_count += __o._M_count;
100 _M_cost += __o._M_cost;
101 _M_resize += __o._M_resize;
106 __destruct(std::size_t __num, std::size_t __inum)
109 _M_item_max =
std::max(_M_item_max, __inum);
113 _M_item_min = __inum;
118 _M_item_min =
std::min(_M_item_min, __inum);
121 _M_item_total += __inum;
127 __resize_cost(std::size_t __from, std::size_t)
132 __resize(std::size_t __from, std::size_t __to)
134 _M_cost += this->__resize_cost(__from, __to);
143 std::size_t _M_total;
144 std::size_t _M_item_min;
145 std::size_t _M_item_max;
146 std::size_t _M_item_total;
147 std::size_t _M_count;
148 std::size_t _M_resize;
165 :
public __trace_base<__container_size_info, __container_size_stack_info>
175 __insert(
const __object_t __obj, __stack_t __stack, std::size_t __num)
180 __construct(
const void* __obj, std::size_t __inum);
184 __destruct(
const void* __obj, std::size_t __num, std::size_t __inum)
189 __object_t __obj_handle =
static_cast<__object_t
>(__obj);
195 __object_info->__destruct(__num, __inum);
196 __retire_object(__obj_handle);
201 __resize(
const void* __obj,
int __from,
int __to)
210 __object_info->__resize(__from, __to);
A container size instrumentation line in the stack table.
Data structures to represent profiling traces.
Base class for a line in the object table.
const _Tp & max(const _Tp &, const _Tp &)
This does what you think it does.
Container size instrumentation trace producer.
__string_type str() const
Copying out the string buffer.
Controlling input and output for std::string.
const _Tp & min(const _Tp &, const _Tp &)
This does what you think it does.
Interface of the profiling runtime library.
Base class for all trace producers.
A container size instrumentation line in the object table.
Data structures to represent a single profiling event.