mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 21:41:14 +08:00
profiler_list_to_slist.h: Fix formatting, other minor stylistic changes.
2010-06-22 Paolo Carlini <paolo.carlini@oracle.com> * include/profile/impl/profiler_list_to_slist.h: Fix formatting, other minor stylistic changes. * include/profile/impl/profiler_container_size.h: Likewise. * include/profile/impl/profiler_vector_size.h: Likewise. * include/profile/impl/profiler_hash_func.h: Likewise. * include/profile/impl/profiler_trace.h: Likewise. * include/profile/impl/profiler_list_to_vector.h: Likewise. * include/profile/impl/profiler_vector_to_list.h: Likewise. * include/profile/impl/profiler_state.h: Likewise. * include/profile/impl/profiler_map_to_unordered_map.h: Likewise. * include/profile/impl/profiler_hashtable_size.h: Likewise. * include/profile/impl/profiler_node.h: Likewise. From-SVN: r161236
This commit is contained in:
parent
b2e894b50a
commit
b0af13eadd
@ -1,3 +1,18 @@
|
||||
2010-06-22 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
* include/profile/impl/profiler_list_to_slist.h: Fix formatting,
|
||||
other minor stylistic changes.
|
||||
* include/profile/impl/profiler_container_size.h: Likewise.
|
||||
* include/profile/impl/profiler_vector_size.h: Likewise.
|
||||
* include/profile/impl/profiler_hash_func.h: Likewise.
|
||||
* include/profile/impl/profiler_trace.h: Likewise.
|
||||
* include/profile/impl/profiler_list_to_vector.h: Likewise.
|
||||
* include/profile/impl/profiler_vector_to_list.h: Likewise.
|
||||
* include/profile/impl/profiler_state.h: Likewise.
|
||||
* include/profile/impl/profiler_map_to_unordered_map.h: Likewise.
|
||||
* include/profile/impl/profiler_hashtable_size.h: Likewise.
|
||||
* include/profile/impl/profiler_node.h: Likewise.
|
||||
|
||||
2010-06-22 Matthias Klose <doko@ubuntu.com>
|
||||
|
||||
* python/libstdcxx/v6/printers.py: Don't use string exceptions.
|
||||
|
@ -55,188 +55,178 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
/** @brief A container size instrumentation line in the object table. */
|
||||
class __container_size_info
|
||||
: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__container_size_info()
|
||||
: _M_init(0), _M_max(0), _M_min(0), _M_total(0), _M_item_min(0),
|
||||
_M_item_max(0), _M_item_total(0), _M_count(0), _M_resize(0), _M_cost(0)
|
||||
{ }
|
||||
|
||||
/** @brief A container size instrumentation line in the object table. */
|
||||
class __container_size_info: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__container_size_info();
|
||||
__container_size_info(const __container_size_info& __o);
|
||||
__container_size_info(__stack_t __stack, size_t __num);
|
||||
virtual ~__container_size_info() {}
|
||||
__container_size_info(const __container_size_info& __o)
|
||||
: __object_info_base(__o), _M_init(__o._M_init), _M_max(__o._M_max),
|
||||
_M_min(__o._M_min), _M_total(__o._M_total),
|
||||
_M_item_min(__o._M_item_min), _M_item_max(__o._M_item_max),
|
||||
_M_item_total(__o._M_item_total), _M_count(__o._M_count),
|
||||
_M_resize(__o._M_resize), _M_cost(__o._M_cost)
|
||||
{ }
|
||||
|
||||
void __write(FILE* f) const;
|
||||
float __magnitude() const { return static_cast<float>(_M_cost); }
|
||||
const char* __advice() const;
|
||||
__container_size_info(__stack_t __stack, size_t __num)
|
||||
: __object_info_base(__stack), _M_init(__num), _M_max(__num),
|
||||
_M_min(0), _M_total(0), _M_item_min(0), _M_item_max(0),
|
||||
_M_item_total(0), _M_count(0), _M_resize(0), _M_cost(0)
|
||||
{ }
|
||||
|
||||
void __merge(const __container_size_info& __o);
|
||||
// Call if a container is destructed or cleaned.
|
||||
void __destruct(size_t __num, size_t __inum);
|
||||
// Estimate the cost of resize/rehash.
|
||||
float __resize_cost(size_t __from, size_t __to) { return __from; }
|
||||
// Call if container is resized.
|
||||
void __resize(size_t __from, size_t __to);
|
||||
virtual ~__container_size_info() { }
|
||||
|
||||
private:
|
||||
size_t _M_init;
|
||||
size_t _M_max; // range of # buckets
|
||||
size_t _M_min;
|
||||
size_t _M_total;
|
||||
size_t _M_item_min; // range of # items
|
||||
size_t _M_item_max;
|
||||
size_t _M_item_total;
|
||||
size_t _M_count;
|
||||
size_t _M_resize;
|
||||
size_t _M_cost;
|
||||
};
|
||||
void
|
||||
__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu\n",
|
||||
_M_init, _M_count, _M_cost, _M_resize, _M_min, _M_max, _M_total,
|
||||
_M_item_min, _M_item_max, _M_item_total);
|
||||
}
|
||||
|
||||
inline const char* __container_size_info::__advice() const
|
||||
{
|
||||
std::stringstream __message;
|
||||
if (_M_init < _M_item_max)
|
||||
__message << "change initial container size from " << _M_init
|
||||
<< " to " << _M_item_max;
|
||||
float
|
||||
__magnitude() const
|
||||
{ return static_cast<float>(_M_cost); }
|
||||
|
||||
return strdup(__message.str().c_str());
|
||||
}
|
||||
const char*
|
||||
__advice() const
|
||||
{
|
||||
std::stringstream __message;
|
||||
if (_M_init < _M_item_max)
|
||||
__message << "change initial container size from " << _M_init
|
||||
<< " to " << _M_item_max;
|
||||
return strdup(__message.str().c_str());
|
||||
}
|
||||
|
||||
inline void __container_size_info::__destruct(size_t __num, size_t __inum)
|
||||
{
|
||||
_M_max = std::max(_M_max, __num);
|
||||
_M_item_max = std::max(_M_item_max, __inum);
|
||||
if (_M_min == 0) {
|
||||
_M_min = __num;
|
||||
_M_item_min = __inum;
|
||||
} else {
|
||||
_M_min = std::min(_M_min, __num);
|
||||
_M_item_min = std::min(_M_item_min, __inum);
|
||||
}
|
||||
_M_total += __num;
|
||||
_M_item_total += __inum;
|
||||
_M_count += 1;
|
||||
}
|
||||
void
|
||||
__merge(const __container_size_info& __o)
|
||||
{
|
||||
_M_init = std::max(_M_init, __o._M_init);
|
||||
_M_max = std::max(_M_max, __o._M_max);
|
||||
_M_item_max = std::max(_M_item_max, __o._M_item_max);
|
||||
_M_min = std::min(_M_min, __o._M_min);
|
||||
_M_item_min = std::min(_M_item_min, __o._M_item_min);
|
||||
_M_total += __o._M_total;
|
||||
_M_item_total += __o._M_item_total;
|
||||
_M_count += __o._M_count;
|
||||
_M_cost += __o._M_cost;
|
||||
_M_resize += __o._M_resize;
|
||||
}
|
||||
|
||||
inline void __container_size_info::__resize(size_t __from, size_t __to)
|
||||
{
|
||||
_M_cost += this->__resize_cost(__from, __to);
|
||||
_M_resize += 1;
|
||||
_M_max = std::max(_M_max, __to);
|
||||
}
|
||||
// Call if a container is destructed or cleaned.
|
||||
void
|
||||
__destruct(size_t __num, size_t __inum)
|
||||
{
|
||||
_M_max = std::max(_M_max, __num);
|
||||
_M_item_max = std::max(_M_item_max, __inum);
|
||||
if (_M_min == 0)
|
||||
{
|
||||
_M_min = __num;
|
||||
_M_item_min = __inum;
|
||||
}
|
||||
else
|
||||
{
|
||||
_M_min = std::min(_M_min, __num);
|
||||
_M_item_min = std::min(_M_item_min, __inum);
|
||||
}
|
||||
_M_total += __num;
|
||||
_M_item_total += __inum;
|
||||
_M_count += 1;
|
||||
}
|
||||
|
||||
inline __container_size_info::__container_size_info(__stack_t __stack,
|
||||
size_t __num)
|
||||
: __object_info_base(__stack), _M_init(0), _M_max(0), _M_item_max(0),
|
||||
_M_min(0), _M_item_min(0), _M_total(0), _M_item_total(0), _M_cost(0),
|
||||
_M_count(0), _M_resize(0)
|
||||
{
|
||||
_M_init = _M_max = __num;
|
||||
_M_item_min = _M_item_max = _M_item_total = _M_total = 0;
|
||||
_M_min = 0;
|
||||
_M_count = 0;
|
||||
_M_resize = 0;
|
||||
}
|
||||
// Estimate the cost of resize/rehash.
|
||||
float
|
||||
__resize_cost(size_t __from, size_t)
|
||||
{ return __from; }
|
||||
|
||||
inline void __container_size_info::__merge(const __container_size_info& __o)
|
||||
{
|
||||
_M_init = std::max(_M_init, __o._M_init);
|
||||
_M_max = std::max(_M_max, __o._M_max);
|
||||
_M_item_max = std::max(_M_item_max, __o._M_item_max);
|
||||
_M_min = std::min(_M_min, __o._M_min);
|
||||
_M_item_min = std::min(_M_item_min, __o._M_item_min);
|
||||
_M_total += __o._M_total;
|
||||
_M_item_total += __o._M_item_total;
|
||||
_M_count += __o._M_count;
|
||||
_M_cost += __o._M_cost;
|
||||
_M_resize += __o._M_resize;
|
||||
}
|
||||
// Call if container is resized.
|
||||
void
|
||||
__resize(size_t __from, size_t __to)
|
||||
{
|
||||
_M_cost += this->__resize_cost(__from, __to);
|
||||
_M_resize += 1;
|
||||
_M_max = std::max(_M_max, __to);
|
||||
}
|
||||
|
||||
inline __container_size_info::__container_size_info()
|
||||
: _M_init(0), _M_max(0), _M_item_max(0), _M_min(0), _M_item_min(0),
|
||||
_M_total(0), _M_item_total(0), _M_cost(0), _M_count(0), _M_resize(0)
|
||||
{
|
||||
}
|
||||
private:
|
||||
size_t _M_init;
|
||||
size_t _M_max; // range of # buckets
|
||||
size_t _M_min;
|
||||
size_t _M_total;
|
||||
size_t _M_item_min; // range of # items
|
||||
size_t _M_item_max;
|
||||
size_t _M_item_total;
|
||||
size_t _M_count;
|
||||
size_t _M_resize;
|
||||
size_t _M_cost;
|
||||
};
|
||||
|
||||
inline __container_size_info::__container_size_info(
|
||||
const __container_size_info& __o)
|
||||
: __object_info_base(__o)
|
||||
{
|
||||
_M_init = __o._M_init;
|
||||
_M_max = __o._M_max;
|
||||
_M_item_max = __o._M_item_max;
|
||||
_M_min = __o._M_min;
|
||||
_M_item_min = __o._M_item_min;
|
||||
_M_total = __o._M_total;
|
||||
_M_item_total = __o._M_item_total;
|
||||
_M_cost = __o._M_cost;
|
||||
_M_count = __o._M_count;
|
||||
_M_resize = __o._M_resize;
|
||||
}
|
||||
|
||||
/** @brief A container size instrumentation line in the stack table. */
|
||||
class __container_size_stack_info: public __container_size_info
|
||||
{
|
||||
public:
|
||||
__container_size_stack_info(const __container_size_info& __o)
|
||||
: __container_size_info(__o) {}
|
||||
};
|
||||
/** @brief A container size instrumentation line in the stack table. */
|
||||
class __container_size_stack_info
|
||||
: public __container_size_info
|
||||
{
|
||||
public:
|
||||
__container_size_stack_info(const __container_size_info& __o)
|
||||
: __container_size_info(__o) { }
|
||||
};
|
||||
|
||||
/** @brief Container size instrumentation trace producer. */
|
||||
class __trace_container_size
|
||||
: public __trace_base<__container_size_info, __container_size_stack_info>
|
||||
{
|
||||
public:
|
||||
~__trace_container_size() {}
|
||||
__trace_container_size()
|
||||
: __trace_base<__container_size_info, __container_size_stack_info>() {};
|
||||
|
||||
/** @brief Container size instrumentation trace producer. */
|
||||
class __trace_container_size
|
||||
: public __trace_base<__container_size_info, __container_size_stack_info>
|
||||
{
|
||||
public:
|
||||
~__trace_container_size() { }
|
||||
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void __insert(const __object_t __obj, __stack_t __stack, size_t __num);
|
||||
// Call at destruction/clean to set container final size.
|
||||
void __destruct(const void* __obj, size_t __num, size_t __inum);
|
||||
void __construct(const void* __obj, size_t __inum);
|
||||
// Call at resize to set resize/cost information.
|
||||
void __resize(const void* __obj, int __from, int __to);
|
||||
};
|
||||
__trace_container_size()
|
||||
: __trace_base<__container_size_info, __container_size_stack_info>() { };
|
||||
|
||||
inline void __trace_container_size::__insert(const __object_t __obj,
|
||||
__stack_t __stack, size_t __num)
|
||||
{
|
||||
__add_object(__obj, __container_size_info(__stack, __num));
|
||||
}
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void
|
||||
__insert(const __object_t __obj, __stack_t __stack, size_t __num)
|
||||
{ __add_object(__obj, __container_size_info(__stack, __num)); }
|
||||
|
||||
inline void __container_size_info::__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu %Zu\n",
|
||||
_M_init, _M_count, _M_cost, _M_resize, _M_min, _M_max, _M_total,
|
||||
_M_item_min, _M_item_max, _M_item_total);
|
||||
}
|
||||
// XXX Undefined?
|
||||
void
|
||||
__construct(const void* __obj, size_t __inum);
|
||||
|
||||
// Call at destruction/clean to set container final size.
|
||||
void
|
||||
__destruct(const void* __obj, size_t __num, size_t __inum)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
|
||||
inline void __trace_container_size::__destruct(const void* __obj,
|
||||
size_t __num, size_t __inum)
|
||||
{
|
||||
if (!__is_on()) return;
|
||||
__object_t __obj_handle = static_cast<__object_t>(__obj);
|
||||
|
||||
__object_t __obj_handle = static_cast<__object_t>(__obj);
|
||||
__container_size_info* __object_info = __get_object_info(__obj_handle);
|
||||
if (!__object_info)
|
||||
return;
|
||||
|
||||
__container_size_info* __object_info = __get_object_info(__obj_handle);
|
||||
if (!__object_info)
|
||||
return;
|
||||
__object_info->__destruct(__num, __inum);
|
||||
__retire_object(__obj_handle);
|
||||
}
|
||||
|
||||
__object_info->__destruct(__num, __inum);
|
||||
__retire_object(__obj_handle);
|
||||
}
|
||||
// Call at resize to set resize/cost information.
|
||||
void
|
||||
__resize(const void* __obj, int __from, int __to)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
|
||||
inline void __trace_container_size::__resize(const void* __obj, int __from,
|
||||
int __to)
|
||||
{
|
||||
if (!__is_on()) return;
|
||||
__container_size_info* __object_info = __get_object_info(__obj);
|
||||
if (!__object_info)
|
||||
return;
|
||||
|
||||
__container_size_info* __object_info = __get_object_info(__obj);
|
||||
if (!__object_info)
|
||||
return;
|
||||
|
||||
__object_info->__resize(__from, __to);
|
||||
}
|
||||
__object_info->__resize(__from, __to);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_CONTAINER_SIZE_H */
|
||||
|
@ -52,134 +52,137 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
/** @brief A hash performance instrumentation line in the object table. */
|
||||
class __hashfunc_info
|
||||
: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__hashfunc_info()
|
||||
: _M_longest_chain(0), _M_accesses(0), _M_hops(0) { }
|
||||
|
||||
__hashfunc_info(const __hashfunc_info& __o)
|
||||
: __object_info_base(__o), _M_longest_chain(__o._M_longest_chain),
|
||||
_M_accesses(__o._M_accesses), _M_hops(__o._M_hops) { }
|
||||
|
||||
__hashfunc_info(__stack_t __stack)
|
||||
: __object_info_base(__stack),
|
||||
_M_longest_chain(0), _M_accesses(0), _M_hops(0){ }
|
||||
|
||||
virtual ~__hashfunc_info() {}
|
||||
|
||||
/** @brief A hash performance instrumentation line in the object table. */
|
||||
class __hashfunc_info: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__hashfunc_info()
|
||||
:_M_longest_chain(0), _M_accesses(0), _M_hops(0) {}
|
||||
__hashfunc_info(const __hashfunc_info& o);
|
||||
__hashfunc_info(__stack_t __stack)
|
||||
: __object_info_base(__stack),
|
||||
_M_longest_chain(0), _M_accesses(0), _M_hops(0){}
|
||||
virtual ~__hashfunc_info() {}
|
||||
void
|
||||
__merge(const __hashfunc_info& __o)
|
||||
{
|
||||
_M_longest_chain = std::max(_M_longest_chain, __o._M_longest_chain);
|
||||
_M_accesses += __o._M_accesses;
|
||||
_M_hops += __o._M_hops;
|
||||
}
|
||||
|
||||
void __merge(const __hashfunc_info& __o);
|
||||
void __destruct(size_t __chain, size_t __accesses, size_t __hops);
|
||||
void __write(FILE* __f) const;
|
||||
float __magnitude() const { return static_cast<float>(_M_hops); }
|
||||
const char* __advice() const { return strdup("change hash function"); }
|
||||
void
|
||||
__destruct(size_t __chain, size_t __accesses, size_t __hops)
|
||||
{
|
||||
_M_longest_chain = std::max(_M_longest_chain, __chain);
|
||||
_M_accesses += __accesses;
|
||||
_M_hops += __hops;
|
||||
}
|
||||
|
||||
private:
|
||||
size_t _M_longest_chain;
|
||||
size_t _M_accesses;
|
||||
size_t _M_hops;
|
||||
};
|
||||
void
|
||||
__write(FILE* __f) const
|
||||
{ fprintf(__f, "%Zu %Zu %Zu\n", _M_hops, _M_accesses, _M_longest_chain); }
|
||||
|
||||
inline __hashfunc_info::__hashfunc_info(const __hashfunc_info& __o)
|
||||
: __object_info_base(__o)
|
||||
{
|
||||
_M_longest_chain = __o._M_longest_chain;
|
||||
_M_accesses = __o._M_accesses;
|
||||
_M_hops = __o._M_hops;
|
||||
}
|
||||
float
|
||||
__magnitude() const
|
||||
{ return static_cast<float>(_M_hops); }
|
||||
|
||||
inline void __hashfunc_info::__merge(const __hashfunc_info& __o)
|
||||
{
|
||||
_M_longest_chain = std::max(_M_longest_chain, __o._M_longest_chain);
|
||||
_M_accesses += __o._M_accesses;
|
||||
_M_hops += __o._M_hops;
|
||||
}
|
||||
const char*
|
||||
__advice() const
|
||||
{ return strdup("change hash function"); }
|
||||
|
||||
inline void __hashfunc_info::__destruct(size_t __chain, size_t __accesses,
|
||||
size_t __hops)
|
||||
{
|
||||
_M_longest_chain = std::max(_M_longest_chain, __chain);
|
||||
_M_accesses += __accesses;
|
||||
_M_hops += __hops;
|
||||
}
|
||||
private:
|
||||
size_t _M_longest_chain;
|
||||
size_t _M_accesses;
|
||||
size_t _M_hops;
|
||||
};
|
||||
|
||||
/** @brief A hash performance instrumentation line in the stack table. */
|
||||
class __hashfunc_stack_info: public __hashfunc_info {
|
||||
public:
|
||||
__hashfunc_stack_info(const __hashfunc_info& __o) : __hashfunc_info(__o) {}
|
||||
};
|
||||
|
||||
/** @brief Hash performance instrumentation producer. */
|
||||
class __trace_hash_func
|
||||
: public __trace_base<__hashfunc_info, __hashfunc_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_hash_func();
|
||||
~__trace_hash_func() {}
|
||||
/** @brief A hash performance instrumentation line in the stack table. */
|
||||
class __hashfunc_stack_info
|
||||
: public __hashfunc_info
|
||||
{
|
||||
public:
|
||||
__hashfunc_stack_info(const __hashfunc_info& __o)
|
||||
: __hashfunc_info(__o) { }
|
||||
};
|
||||
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void __insert(__object_t __obj, __stack_t __stack);
|
||||
// Call at destruction/clean to set container final size.
|
||||
void __destruct(const void* __obj, size_t __chain,
|
||||
size_t __accesses, size_t __hops);
|
||||
};
|
||||
|
||||
inline __trace_hash_func::__trace_hash_func()
|
||||
/** @brief Hash performance instrumentation producer. */
|
||||
class __trace_hash_func
|
||||
: public __trace_base<__hashfunc_info, __hashfunc_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_hash_func()
|
||||
: __trace_base<__hashfunc_info, __hashfunc_stack_info>()
|
||||
{
|
||||
__id = "hash-distr";
|
||||
}
|
||||
{ __id = "hash-distr"; }
|
||||
|
||||
inline void __trace_hash_func::__insert(__object_t __obj, __stack_t __stack)
|
||||
{
|
||||
__add_object(__obj, __hashfunc_info(__stack));
|
||||
}
|
||||
~__trace_hash_func() {}
|
||||
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void
|
||||
__insert(__object_t __obj, __stack_t __stack)
|
||||
{ __add_object(__obj, __hashfunc_info(__stack)); }
|
||||
|
||||
inline void __hashfunc_info::__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu\n", _M_hops, _M_accesses, _M_longest_chain);
|
||||
}
|
||||
// Call at destruction/clean to set container final size.
|
||||
void
|
||||
__destruct(const void* __obj, size_t __chain,
|
||||
size_t __accesses, size_t __hops)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
|
||||
inline void __trace_hash_func::__destruct(const void* __obj, size_t __chain,
|
||||
size_t __accesses, size_t __hops)
|
||||
{
|
||||
if (!__is_on()) return;
|
||||
// First find the item from the live objects and update the informations.
|
||||
__hashfunc_info* __objs = __get_object_info(__obj);
|
||||
if (!__objs)
|
||||
return;
|
||||
|
||||
// First find the item from the live objects and update the informations.
|
||||
__hashfunc_info* __objs = __get_object_info(__obj);
|
||||
if (!__objs)
|
||||
return;
|
||||
__objs->__destruct(__chain, __accesses, __hops);
|
||||
__retire_object(__obj);
|
||||
}
|
||||
};
|
||||
|
||||
__objs->__destruct(__chain, __accesses, __hops);
|
||||
__retire_object(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_hash_func_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func) = new __trace_hash_func();
|
||||
}
|
||||
inline void
|
||||
__trace_hash_func_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_hash_func) = new __trace_hash_func(); }
|
||||
|
||||
inline void __trace_hash_func_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_hash_func)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__write(__f);
|
||||
inline void
|
||||
__trace_hash_func_report(FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_hash_func))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__write(__f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_hash_func_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_hash_func_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__insert(__obj, __get_stack());
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__insert(__obj, __get_stack());
|
||||
}
|
||||
|
||||
inline void __trace_hash_func_destruct(const void* __obj, size_t __chain,
|
||||
size_t __accesses, size_t __hops)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_hash_func_destruct(const void* __obj, size_t __chain,
|
||||
size_t __accesses, size_t __hops)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__destruct(__obj, __chain, __accesses,
|
||||
__hops);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_hash_func)->__destruct(__obj, __chain, __accesses,
|
||||
__hops);
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_HASH_FUNC_H */
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the terms
|
||||
@ -54,54 +54,60 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
|
||||
/** @brief Hashtable size instrumentation trace producer. */
|
||||
class __trace_hashtable_size : public __trace_container_size
|
||||
{
|
||||
public:
|
||||
__trace_hashtable_size() : __trace_container_size()
|
||||
/** @brief Hashtable size instrumentation trace producer. */
|
||||
class __trace_hashtable_size
|
||||
: public __trace_container_size
|
||||
{
|
||||
__id = "hashtable-size";
|
||||
public:
|
||||
__trace_hashtable_size()
|
||||
: __trace_container_size()
|
||||
{ __id = "hashtable-size"; }
|
||||
};
|
||||
|
||||
inline void
|
||||
__trace_hashtable_size_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_hashtable_size) = new __trace_hashtable_size(); }
|
||||
|
||||
inline void
|
||||
__trace_hashtable_size_report(FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_hashtable_size))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->
|
||||
__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__write(__f);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
inline void __trace_hashtable_size_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size) = new __trace_hashtable_size();
|
||||
}
|
||||
|
||||
inline void __trace_hashtable_size_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_hashtable_size)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__write(__f);
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_hashtable_size_construct(const void* __obj, size_t __num)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_hashtable_size_construct(const void* __obj, size_t __num)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__insert(__obj, __get_stack(),
|
||||
__num);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__insert(__obj, __get_stack(),
|
||||
__num);
|
||||
}
|
||||
|
||||
inline void __trace_hashtable_size_destruct(const void* __obj, size_t __num,
|
||||
size_t __inum)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_hashtable_size_destruct(const void* __obj, size_t __num,
|
||||
size_t __inum)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__destruct(__obj, __num, __inum);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__destruct(__obj, __num, __inum);
|
||||
}
|
||||
|
||||
inline void __trace_hashtable_size_resize(const void* __obj, size_t __from,
|
||||
size_t __to)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_hashtable_size_resize(const void* __obj, size_t __from,
|
||||
size_t __to)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__resize(__obj, __from, __to);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_hashtable_size)->__resize(__obj, __from, __to);
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the terms
|
||||
@ -52,131 +52,173 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
class __list2slist_info
|
||||
: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__list2slist_info()
|
||||
: _M_rewind(false), _M_operations(0) { }
|
||||
|
||||
__list2slist_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_rewind(false), _M_operations(0) { }
|
||||
|
||||
class __list2slist_info: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__list2slist_info() : _M_rewind(false), _M_operations(0) {}
|
||||
__list2slist_info(__stack_t __stack)
|
||||
: _M_rewind(false), _M_operations(0),__object_info_base(__stack) {}
|
||||
virtual ~__list2slist_info() {}
|
||||
__list2slist_info(const __list2slist_info& __o) : __object_info_base(__o)
|
||||
{ _M_rewind = __o._M_rewind; _M_operations = __o._M_operations; }
|
||||
// XXX: the magnitude should be multiplied with a constant factor F,
|
||||
// where F is 1 when the malloc size class of list nodes is different
|
||||
// from the malloc size class of slist nodes. When they fall into the same
|
||||
// class, the only slist benefit is from having to set fewer links, so
|
||||
// the factor F should be much smaller, closer to 0 than to 1.
|
||||
// This could be implemented by passing the size classes in the config file.
|
||||
// For now, we always assume F to be 1.
|
||||
float __magnitude() const
|
||||
{ if (!_M_rewind) return _M_operations; else return 0; }
|
||||
void __merge(const __list2slist_info& __o) {};
|
||||
void __write(FILE* __f) const;
|
||||
const char* __advice() const
|
||||
{ return strdup("change std::list to std::forward_list"); }
|
||||
void __opr_rewind() { _M_rewind = true; _M_valid = false;}
|
||||
void __record_operation() { _M_operations++; }
|
||||
bool __has_rewind() { return _M_rewind; }
|
||||
virtual ~__list2slist_info() { }
|
||||
|
||||
private:
|
||||
bool _M_rewind;
|
||||
size_t _M_operations;
|
||||
};
|
||||
__list2slist_info(const __list2slist_info& __o)
|
||||
: __object_info_base(__o), _M_rewind(__o._M_rewind),
|
||||
_M_operations(__o._M_operations) { }
|
||||
|
||||
// XXX: the magnitude should be multiplied with a constant factor F,
|
||||
// where F is 1 when the malloc size class of list nodes is different
|
||||
// from the malloc size class of slist nodes. When they fall into the same
|
||||
// class, the only slist benefit is from having to set fewer links, so
|
||||
// the factor F should be much smaller, closer to 0 than to 1.
|
||||
// This could be implemented by passing the size classes in the config
|
||||
// file. For now, we always assume F to be 1.
|
||||
|
||||
class __list2slist_stack_info: public __list2slist_info {
|
||||
public:
|
||||
__list2slist_stack_info(const __list2slist_info& __o)
|
||||
: __list2slist_info(__o) {}
|
||||
};
|
||||
float
|
||||
__magnitude() const
|
||||
{
|
||||
if (!_M_rewind)
|
||||
return _M_operations;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
__merge(const __list2slist_info&) { };
|
||||
|
||||
class __trace_list_to_slist
|
||||
: public __trace_base<__list2slist_info, __list2slist_stack_info>
|
||||
{
|
||||
public:
|
||||
~__trace_list_to_slist() {}
|
||||
__trace_list_to_slist()
|
||||
: __trace_base<__list2slist_info, __list2slist_stack_info>()
|
||||
{ __id = "list-to-slist"; }
|
||||
void __opr_rewind(const void* __obj);
|
||||
void __record_operation(const void* __obj);
|
||||
void __insert(const __object_t __obj, __stack_t __stack)
|
||||
{ __add_object(__obj, __list2slist_info(__stack)); }
|
||||
void __destruct(const void* __obj);
|
||||
};
|
||||
void
|
||||
__write(FILE* __f) const
|
||||
{ fprintf(__f, "%s\n", _M_rewind ? "invalid" : "valid"); }
|
||||
|
||||
inline void __list2slist_info::__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%s\n", _M_rewind ? "invalid" : "valid");
|
||||
}
|
||||
const char*
|
||||
__advice() const
|
||||
{ return strdup("change std::list to std::forward_list"); }
|
||||
|
||||
inline void __trace_list_to_slist::__destruct(const void* __obj)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
void
|
||||
__opr_rewind()
|
||||
{
|
||||
_M_rewind = true;
|
||||
_M_valid = false;
|
||||
}
|
||||
|
||||
__list2slist_info* __res = __get_object_info(__obj);
|
||||
if (!__res)
|
||||
return;
|
||||
void
|
||||
__record_operation()
|
||||
{ _M_operations++; }
|
||||
|
||||
__retire_object(__obj);
|
||||
}
|
||||
bool
|
||||
__has_rewind()
|
||||
{ return _M_rewind; }
|
||||
|
||||
inline void __trace_list_to_slist_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist) = new __trace_list_to_slist();
|
||||
}
|
||||
private:
|
||||
bool _M_rewind;
|
||||
size_t _M_operations;
|
||||
};
|
||||
|
||||
inline void __trace_list_to_slist_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_list_to_slist)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__write(__f);
|
||||
class __list2slist_stack_info
|
||||
: public __list2slist_info
|
||||
{
|
||||
public:
|
||||
__list2slist_stack_info(const __list2slist_info& __o)
|
||||
: __list2slist_info(__o) { }
|
||||
};
|
||||
|
||||
class __trace_list_to_slist
|
||||
: public __trace_base<__list2slist_info, __list2slist_stack_info>
|
||||
{
|
||||
public:
|
||||
~__trace_list_to_slist() { }
|
||||
|
||||
__trace_list_to_slist()
|
||||
: __trace_base<__list2slist_info, __list2slist_stack_info>()
|
||||
{ __id = "list-to-slist"; }
|
||||
|
||||
void
|
||||
__opr_rewind(const void* __obj)
|
||||
{
|
||||
__list2slist_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_rewind();
|
||||
}
|
||||
|
||||
void
|
||||
__record_operation(const void* __obj)
|
||||
{
|
||||
__list2slist_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__record_operation();
|
||||
}
|
||||
|
||||
void
|
||||
__insert(const __object_t __obj, __stack_t __stack)
|
||||
{ __add_object(__obj, __list2slist_info(__stack)); }
|
||||
|
||||
void
|
||||
__destruct(const void* __obj)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
|
||||
__list2slist_info* __res = __get_object_info(__obj);
|
||||
if (!__res)
|
||||
return;
|
||||
|
||||
__retire_object(__obj);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
inline void
|
||||
__trace_list_to_slist_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_list_to_slist) = new __trace_list_to_slist(); }
|
||||
|
||||
inline void
|
||||
__trace_list_to_slist_report(FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_list_to_slist))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->
|
||||
__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__write(__f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_list_to_slist::__opr_rewind(const void* __obj)
|
||||
{
|
||||
__list2slist_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_rewind();
|
||||
}
|
||||
inline void
|
||||
__trace_list_to_slist_rewind(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_list_to_slist::__record_operation(const void* __obj)
|
||||
{
|
||||
__list2slist_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__record_operation();
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__opr_rewind(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_slist_rewind(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_list_to_slist_operation(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__opr_rewind(__obj);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__record_operation(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_slist_operation(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_list_to_slist_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__record_operation(__obj);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__insert(__obj, __get_stack());
|
||||
}
|
||||
|
||||
inline void __trace_list_to_slist_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_list_to_slist_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__insert(__obj, __get_stack());
|
||||
}
|
||||
|
||||
inline void __trace_list_to_slist_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__destruct(__obj);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_slist)->__destruct(__obj);
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_LIST_TO_SLIST_H */
|
||||
|
@ -54,260 +54,287 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
/** @brief A list-to-vector instrumentation line in the object table. */
|
||||
class __list2vector_info
|
||||
: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__list2vector_info()
|
||||
: _M_shift_count(0), _M_iterate(0), _M_resize(0), _M_list_cost(0),
|
||||
_M_vector_cost(0), _M_valid(true), _M_max_size(0) { }
|
||||
|
||||
/** @brief A list-to-vector instrumentation line in the object table. */
|
||||
class __list2vector_info: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__list2vector_info()
|
||||
:_M_shift_count(0), _M_iterate(0), _M_resize(0), _M_list_cost(0),
|
||||
_M_vector_cost(0), _M_valid(true), _M_max_size(0) {}
|
||||
__list2vector_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
|
||||
_M_resize(0), _M_list_cost(0), _M_vector_cost(0), _M_valid(true),
|
||||
_M_max_size(0) {}
|
||||
virtual ~__list2vector_info() {}
|
||||
__list2vector_info(const __list2vector_info& __o);
|
||||
void __merge(const __list2vector_info& __o);
|
||||
void __write(FILE* __f) const;
|
||||
float __magnitude() const { return _M_list_cost - _M_vector_cost; }
|
||||
const char* __advice() const;
|
||||
size_t __shift_count() { return _M_shift_count; }
|
||||
size_t __iterate() { return _M_iterate; }
|
||||
float __list_cost() { return _M_list_cost; }
|
||||
size_t __resize() { return _M_resize; }
|
||||
void __set_list_cost(float __lc) { _M_list_cost = __lc; }
|
||||
void __set_vector_cost(float __vc) { _M_vector_cost = __vc; }
|
||||
bool __is_valid() { return _M_valid; }
|
||||
void __set_invalid() { _M_valid = false; }
|
||||
__list2vector_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
|
||||
_M_resize(0), _M_list_cost(0), _M_vector_cost(0), _M_valid(true),
|
||||
_M_max_size(0) { }
|
||||
|
||||
void __opr_insert(size_t __shift, size_t __size);
|
||||
void __opr_iterate(size_t __num) { _M_iterate += __num;}
|
||||
virtual ~__list2vector_info() { }
|
||||
|
||||
void __resize(size_t __from, size_t __to);
|
||||
__list2vector_info(const __list2vector_info& __o)
|
||||
: __object_info_base(__o), _M_shift_count(__o._M_shift_count),
|
||||
_M_iterate(__o._M_iterate), _M_resize(__o._M_resize),
|
||||
_M_list_cost(__o._M_list_cost), _M_vector_cost(__o._M_vector_cost),
|
||||
_M_valid(__o._M_valid), _M_max_size(__o._M_max_size) { }
|
||||
|
||||
private:
|
||||
size_t _M_shift_count;
|
||||
size_t _M_iterate;
|
||||
size_t _M_resize;
|
||||
float _M_list_cost;
|
||||
float _M_vector_cost;
|
||||
bool _M_valid;
|
||||
size_t _M_max_size;
|
||||
};
|
||||
void
|
||||
__merge(const __list2vector_info& __o)
|
||||
{
|
||||
_M_shift_count += __o._M_shift_count;
|
||||
_M_iterate += __o._M_iterate;
|
||||
_M_vector_cost += __o._M_vector_cost;
|
||||
_M_list_cost += __o._M_list_cost;
|
||||
_M_valid &= __o._M_valid;
|
||||
_M_resize += __o._M_resize;
|
||||
_M_max_size = std::max( _M_max_size, __o._M_max_size);
|
||||
}
|
||||
|
||||
inline __list2vector_info::__list2vector_info(const __list2vector_info& __o)
|
||||
: __object_info_base(__o)
|
||||
{
|
||||
_M_shift_count = __o._M_shift_count;
|
||||
_M_iterate = __o._M_iterate;
|
||||
_M_vector_cost = __o._M_vector_cost;
|
||||
_M_list_cost = __o._M_list_cost;
|
||||
_M_valid = __o._M_valid;
|
||||
_M_resize = __o._M_resize;
|
||||
_M_max_size = __o._M_max_size;
|
||||
}
|
||||
void
|
||||
__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n", _M_shift_count, _M_resize,
|
||||
_M_iterate, _M_vector_cost, _M_list_cost);
|
||||
}
|
||||
|
||||
inline const char* __list2vector_info::__advice() const {
|
||||
std::stringstream __sstream;
|
||||
__sstream
|
||||
<< "change std::list to std::vector and its initial size from 0 to "
|
||||
<< _M_max_size;
|
||||
return strdup(__sstream.str().c_str());
|
||||
}
|
||||
float
|
||||
__magnitude() const
|
||||
{ return _M_list_cost - _M_vector_cost; }
|
||||
|
||||
const char*
|
||||
__advice() const
|
||||
{
|
||||
std::stringstream __sstream;
|
||||
__sstream
|
||||
<< "change std::list to std::vector and its initial size from 0 to "
|
||||
<< _M_max_size;
|
||||
return strdup(__sstream.str().c_str());
|
||||
}
|
||||
|
||||
inline void __list2vector_info::__merge(const __list2vector_info& __o)
|
||||
{
|
||||
_M_shift_count += __o._M_shift_count;
|
||||
_M_iterate += __o._M_iterate;
|
||||
_M_vector_cost += __o._M_vector_cost;
|
||||
_M_list_cost += __o._M_list_cost;
|
||||
_M_valid &= __o._M_valid;
|
||||
_M_resize += __o._M_resize;
|
||||
_M_max_size = std::max( _M_max_size, __o._M_max_size);
|
||||
}
|
||||
size_t
|
||||
__shift_count()
|
||||
{ return _M_shift_count; }
|
||||
|
||||
size_t
|
||||
__iterate()
|
||||
{ return _M_iterate; }
|
||||
|
||||
float
|
||||
__list_cost()
|
||||
{ return _M_list_cost; }
|
||||
|
||||
size_t
|
||||
__resize()
|
||||
{ return _M_resize; }
|
||||
|
||||
void
|
||||
__set_list_cost(float __lc)
|
||||
{ _M_list_cost = __lc; }
|
||||
|
||||
void
|
||||
__set_vector_cost(float __vc)
|
||||
{ _M_vector_cost = __vc; }
|
||||
|
||||
bool
|
||||
__is_valid()
|
||||
{ return _M_valid; }
|
||||
|
||||
void
|
||||
__set_invalid()
|
||||
{ _M_valid = false; }
|
||||
|
||||
inline void __list2vector_info::__opr_insert(size_t __shift, size_t __size)
|
||||
{
|
||||
_M_shift_count += __shift;
|
||||
_M_max_size = std::max(_M_max_size, __size);
|
||||
}
|
||||
void
|
||||
__opr_insert(size_t __shift, size_t __size)
|
||||
{
|
||||
_M_shift_count += __shift;
|
||||
_M_max_size = std::max(_M_max_size, __size);
|
||||
}
|
||||
|
||||
inline void __list2vector_info::__resize(size_t __from, size_t __to)
|
||||
{
|
||||
_M_resize += __from;
|
||||
}
|
||||
void
|
||||
__opr_iterate(size_t __num)
|
||||
{ _M_iterate += __num;}
|
||||
|
||||
class __list2vector_stack_info: public __list2vector_info {
|
||||
public:
|
||||
__list2vector_stack_info(const __list2vector_info& __o)
|
||||
: __list2vector_info(__o) {}
|
||||
};
|
||||
void
|
||||
__resize(size_t __from, size_t)
|
||||
{ _M_resize += __from; }
|
||||
|
||||
class __trace_list_to_vector
|
||||
: public __trace_base<__list2vector_info, __list2vector_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_list_to_vector();
|
||||
~__trace_list_to_vector() {}
|
||||
private:
|
||||
size_t _M_shift_count;
|
||||
size_t _M_iterate;
|
||||
size_t _M_resize;
|
||||
float _M_list_cost;
|
||||
float _M_vector_cost;
|
||||
bool _M_valid;
|
||||
size_t _M_max_size;
|
||||
};
|
||||
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void __insert(__object_t __obj, __stack_t __stack);
|
||||
// Call at destruction/clean to set container final size.
|
||||
void __destruct(const void* __obj);
|
||||
class __list2vector_stack_info
|
||||
: public __list2vector_info
|
||||
{
|
||||
public:
|
||||
__list2vector_stack_info(const __list2vector_info& __o)
|
||||
: __list2vector_info(__o) {}
|
||||
};
|
||||
|
||||
// Find the node in the live map.
|
||||
__list2vector_info* __find(const void* __obj);
|
||||
|
||||
// Collect cost of operations.
|
||||
void __opr_insert(const void* __obj, size_t __shift, size_t __size);
|
||||
void __opr_iterate(const void* __obj, size_t __num);
|
||||
void __invalid_operator(const void* __obj);
|
||||
void __resize(const void* __obj, size_t __from, size_t __to);
|
||||
float __vector_cost(size_t __shift, size_t __iterate);
|
||||
float __list_cost(size_t __shift, size_t __iterate);
|
||||
};
|
||||
|
||||
inline __trace_list_to_vector::__trace_list_to_vector()
|
||||
class __trace_list_to_vector
|
||||
: public __trace_base<__list2vector_info, __list2vector_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_list_to_vector()
|
||||
: __trace_base<__list2vector_info, __list2vector_stack_info>()
|
||||
{
|
||||
__id = "list-to-vector";
|
||||
}
|
||||
{ __id = "list-to-vector"; }
|
||||
|
||||
inline void __trace_list_to_vector::__insert(__object_t __obj,
|
||||
__stack_t __stack)
|
||||
{
|
||||
__add_object(__obj, __list2vector_info(__stack));
|
||||
}
|
||||
~__trace_list_to_vector() { }
|
||||
|
||||
inline void __list2vector_info::__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n",
|
||||
_M_shift_count, _M_resize, _M_iterate, _M_vector_cost, _M_list_cost);
|
||||
}
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void
|
||||
__insert(__object_t __obj, __stack_t __stack)
|
||||
{ __add_object(__obj, __list2vector_info(__stack)); }
|
||||
|
||||
inline float __trace_list_to_vector::__vector_cost(size_t __shift,
|
||||
size_t __iterate)
|
||||
{
|
||||
// The resulting vector will use a 'reserve' method.
|
||||
return __shift * _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value +
|
||||
__iterate * _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value;
|
||||
}
|
||||
// Call at destruction/clean to set container final size.
|
||||
void
|
||||
__destruct(const void* __obj)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
|
||||
inline float __trace_list_to_vector::__list_cost(size_t __shift,
|
||||
size_t __iterate)
|
||||
{
|
||||
return __shift * _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value +
|
||||
__iterate * _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value;
|
||||
}
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (!__res)
|
||||
return;
|
||||
|
||||
inline void __trace_list_to_vector::__destruct(const void* __obj)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
float __vc = __vector_cost(__res->__shift_count(), __res->__iterate());
|
||||
float __lc = __list_cost(__res->__shift_count(), __res->__iterate());
|
||||
__res->__set_vector_cost(__vc);
|
||||
__res->__set_list_cost(__lc);
|
||||
__retire_object(__obj);
|
||||
}
|
||||
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (!__res)
|
||||
return;
|
||||
// Find the node in the live map.
|
||||
__list2vector_info* __find(const void* __obj);
|
||||
|
||||
float __vc = __vector_cost(__res->__shift_count(), __res->__iterate());
|
||||
float __lc = __list_cost(__res->__shift_count(), __res->__iterate());
|
||||
__res->__set_vector_cost(__vc);
|
||||
__res->__set_list_cost(__lc);
|
||||
__retire_object(__obj);
|
||||
}
|
||||
// Collect cost of operations.
|
||||
void
|
||||
__opr_insert(const void* __obj, size_t __shift, size_t __size)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_insert(__shift, __size);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector::__opr_insert(const void* __obj,
|
||||
size_t __shift, size_t __size)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_insert(__shift, __size);
|
||||
}
|
||||
void
|
||||
__opr_iterate(const void* __obj, size_t __num)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_iterate(__num);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector::__opr_iterate(const void* __obj,
|
||||
size_t __num)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res) {
|
||||
__res->__opr_iterate(__num);
|
||||
void
|
||||
__invalid_operator(const void* __obj)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__set_invalid();
|
||||
}
|
||||
|
||||
void
|
||||
__resize(const void* __obj, size_t __from, size_t __to)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__resize(__from, __to);
|
||||
}
|
||||
|
||||
float
|
||||
__vector_cost(size_t __shift, size_t __iterate)
|
||||
{
|
||||
// The resulting vector will use a 'reserve' method.
|
||||
return (__shift
|
||||
* _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value
|
||||
+ __iterate
|
||||
* _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value);
|
||||
}
|
||||
|
||||
float
|
||||
__list_cost(size_t __shift, size_t __iterate)
|
||||
{
|
||||
return (__shift
|
||||
* _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value
|
||||
+ __iterate
|
||||
* _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
inline void
|
||||
__trace_list_to_vector_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_list_to_vector) = new __trace_list_to_vector(); }
|
||||
|
||||
inline void
|
||||
__trace_list_to_vector_report(FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_list_to_vector))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->
|
||||
__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__write(__f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector::__invalid_operator(const void* __obj)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__set_invalid();
|
||||
}
|
||||
inline void
|
||||
__trace_list_to_vector_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_list_to_vector::__resize(const void* __obj, size_t __from,
|
||||
size_t __to)
|
||||
{
|
||||
__list2vector_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__resize(__from, __to);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector) = new __trace_list_to_vector();
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_list_to_vector)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__write(__f);
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__insert(__obj, __get_stack());
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_list_to_vector_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__insert(__obj, __get_stack());
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__destruct(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_list_to_vector_insert(const void* __obj,
|
||||
size_t __shift, size_t __size)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__destruct(__obj);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__opr_insert(__obj, __shift,
|
||||
__size);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector_insert(const void* __obj,
|
||||
size_t __shift, size_t __size)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_list_to_vector_iterate(const void* __obj, size_t __num = 1)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__opr_insert(__obj, __shift,
|
||||
__size);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__opr_iterate(__obj, __num);
|
||||
}
|
||||
|
||||
inline void
|
||||
__trace_list_to_vector_invalid_operator(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_list_to_vector_iterate(const void* __obj, size_t __num = 1)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__invalid_operator(__obj);
|
||||
}
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__opr_iterate(__obj, __num);
|
||||
}
|
||||
inline void
|
||||
__trace_list_to_vector_resize(const void* __obj,
|
||||
size_t __from, size_t __to)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_list_to_vector_invalid_operator(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__invalid_operator(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_list_to_vector_resize(const void* __obj,
|
||||
size_t __from, size_t __to)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__resize(__obj, __from, __to);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_list_to_vector)->__resize(__obj, __from, __to);
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_LIST_TO_VECTOR_H__ */
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the terms
|
||||
@ -52,241 +52,255 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
|
||||
inline int __log2(size_t __size)
|
||||
{
|
||||
for (int __bit_count = sizeof(size_t) - 1; __bit_count >= 0; -- __bit_count)
|
||||
inline int
|
||||
__log2(size_t __size)
|
||||
{
|
||||
if ((2 << __bit_count) & __size) {
|
||||
return __bit_count;
|
||||
for (int __bit_count = sizeof(size_t) - 1; __bit_count >= 0;
|
||||
-- __bit_count)
|
||||
if ((2 << __bit_count) & __size)
|
||||
return __bit_count;
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline float
|
||||
__map_insert_cost(size_t __size)
|
||||
{ return (_GLIBCXX_PROFILE_DATA(__map_insert_cost_factor).__value
|
||||
* static_cast<float>(__log2(__size))); }
|
||||
|
||||
inline float
|
||||
__map_erase_cost(size_t __size)
|
||||
{ return (_GLIBCXX_PROFILE_DATA(__map_erase_cost_factor).__value
|
||||
* static_cast<float>(__log2(__size))); }
|
||||
|
||||
inline float
|
||||
__map_find_cost(size_t __size)
|
||||
{ return (_GLIBCXX_PROFILE_DATA(__map_find_cost_factor).__value
|
||||
* static_cast<float>(__log2(__size))); }
|
||||
|
||||
/** @brief A map-to-unordered_map instrumentation line in the
|
||||
object table. */
|
||||
class __map2umap_info
|
||||
: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__map2umap_info()
|
||||
: _M_insert(0), _M_erase(0), _M_find(0), _M_iterate(0),
|
||||
_M_umap_cost(0.0), _M_map_cost(0.0), _M_valid(true) { }
|
||||
|
||||
__map2umap_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_insert(0), _M_erase(0), _M_find(0),
|
||||
_M_iterate(0), _M_umap_cost(0.0), _M_map_cost(0.0), _M_valid(true) { }
|
||||
|
||||
virtual ~__map2umap_info() { }
|
||||
|
||||
__map2umap_info(const __map2umap_info& __o)
|
||||
: __object_info_base(__o), _M_insert(__o._M_insert),
|
||||
_M_erase(__o._M_erase), _M_find(__o._M_find),
|
||||
_M_iterate(__o._M_iterate), _M_umap_cost(__o._M_umap_cost),
|
||||
_M_map_cost(__o._M_map_cost), _M_valid(__o._M_valid) { }
|
||||
|
||||
void
|
||||
__merge(const __map2umap_info& __o)
|
||||
{
|
||||
_M_insert += __o._M_insert;
|
||||
_M_erase += __o._M_erase;
|
||||
_M_find += __o._M_find;
|
||||
_M_umap_cost += __o._M_umap_cost;
|
||||
_M_map_cost += __o._M_map_cost;
|
||||
_M_valid &= __o._M_valid;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline float __map_insert_cost(size_t __size)
|
||||
{
|
||||
return (_GLIBCXX_PROFILE_DATA(__map_insert_cost_factor).__value
|
||||
* static_cast<float>(__log2(__size)));
|
||||
}
|
||||
void
|
||||
__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %Zu %.0f %.0f %s\n",
|
||||
_M_insert, _M_erase, _M_find, _M_iterate, _M_map_cost,
|
||||
_M_umap_cost, _M_valid ? "valid" : "invalid");
|
||||
}
|
||||
|
||||
float
|
||||
__magnitude() const
|
||||
{ return _M_map_cost - _M_umap_cost; }
|
||||
|
||||
inline float __map_erase_cost(size_t __size)
|
||||
{
|
||||
return (_GLIBCXX_PROFILE_DATA(__map_erase_cost_factor).__value
|
||||
* static_cast<float>(__log2(__size)));
|
||||
}
|
||||
const char*
|
||||
__advice() const
|
||||
{ return strdup("change std::map to std::unordered_map"); }
|
||||
|
||||
inline float __map_find_cost(size_t __size)
|
||||
{
|
||||
return (_GLIBCXX_PROFILE_DATA(__map_find_cost_factor).__value
|
||||
* static_cast<float>(__log2(__size)));
|
||||
}
|
||||
void
|
||||
__record_insert(size_t __size, size_t __count)
|
||||
{
|
||||
_M_insert += __count;
|
||||
_M_map_cost += __count * __map_insert_cost(__size);
|
||||
_M_umap_cost
|
||||
+= (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__umap_insert_cost_factor).__value);
|
||||
}
|
||||
|
||||
/** @brief A map-to-unordered_map instrumentation line in the object table. */
|
||||
class __map2umap_info: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__map2umap_info()
|
||||
: _M_insert(0), _M_erase(0), _M_find(0), _M_iterate(0),
|
||||
_M_map_cost(0.0), _M_umap_cost(0.0), _M_valid(true) {}
|
||||
__map2umap_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_insert(0), _M_erase(0), _M_find(0),
|
||||
_M_iterate(0), _M_map_cost(0.0), _M_umap_cost(0.0), _M_valid(true) {}
|
||||
virtual ~__map2umap_info() {}
|
||||
__map2umap_info(const __map2umap_info& o);
|
||||
void __merge(const __map2umap_info& o);
|
||||
void __write(FILE* __f) const;
|
||||
float __magnitude() const { return _M_map_cost - _M_umap_cost; }
|
||||
const char* __advice() const;
|
||||
void
|
||||
__record_erase(size_t __size, size_t __count)
|
||||
{
|
||||
_M_erase += __count;
|
||||
_M_map_cost += __count * __map_erase_cost(__size);
|
||||
_M_umap_cost
|
||||
+= (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__umap_erase_cost_factor).__value);
|
||||
}
|
||||
|
||||
void __record_insert(size_t __size, size_t __count);
|
||||
void __record_erase(size_t __size, size_t __count);
|
||||
void __record_find(size_t __size);
|
||||
void __record_iterate(size_t __count);
|
||||
void __record_invalidate();
|
||||
void
|
||||
__record_find(size_t __size)
|
||||
{
|
||||
_M_find += 1;
|
||||
_M_map_cost += __map_find_cost(__size);
|
||||
_M_umap_cost += _GLIBCXX_PROFILE_DATA(__umap_find_cost_factor).__value;
|
||||
}
|
||||
|
||||
private:
|
||||
size_t _M_insert;
|
||||
size_t _M_erase;
|
||||
size_t _M_find;
|
||||
size_t _M_iterate;
|
||||
float _M_umap_cost;
|
||||
float _M_map_cost;
|
||||
bool _M_valid;
|
||||
};
|
||||
void
|
||||
__record_iterate(size_t __count)
|
||||
{
|
||||
_M_iterate += __count;
|
||||
_M_map_cost
|
||||
+= (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__map_iterate_cost_factor).__value);
|
||||
_M_umap_cost
|
||||
+= (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__umap_iterate_cost_factor).__value);
|
||||
}
|
||||
|
||||
inline const char* __map2umap_info::__advice() const
|
||||
{
|
||||
return strdup("change std::map to std::unordered_map");
|
||||
}
|
||||
void
|
||||
__record_invalidate()
|
||||
{ _M_valid = false; }
|
||||
|
||||
inline __map2umap_info::__map2umap_info(const __map2umap_info& __o)
|
||||
: __object_info_base(__o),
|
||||
_M_insert(__o._M_insert),
|
||||
_M_erase(__o._M_erase),
|
||||
_M_find(__o._M_find),
|
||||
_M_iterate(__o._M_iterate),
|
||||
_M_map_cost(__o._M_map_cost),
|
||||
_M_umap_cost(__o._M_umap_cost),
|
||||
_M_valid(__o._M_valid)
|
||||
{}
|
||||
private:
|
||||
size_t _M_insert;
|
||||
size_t _M_erase;
|
||||
size_t _M_find;
|
||||
size_t _M_iterate;
|
||||
float _M_umap_cost;
|
||||
float _M_map_cost;
|
||||
bool _M_valid;
|
||||
};
|
||||
|
||||
inline void __map2umap_info::__merge(const __map2umap_info& __o)
|
||||
{
|
||||
_M_insert += __o._M_insert;
|
||||
_M_erase += __o._M_erase;
|
||||
_M_find += __o._M_find;
|
||||
_M_map_cost += __o._M_map_cost;
|
||||
_M_umap_cost += __o._M_umap_cost;
|
||||
_M_valid &= __o._M_valid;
|
||||
}
|
||||
|
||||
inline void __map2umap_info:: __record_insert(size_t __size, size_t __count)
|
||||
{
|
||||
_M_insert += __count;
|
||||
_M_map_cost += __count * __map_insert_cost(__size);
|
||||
_M_umap_cost += (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__umap_insert_cost_factor).__value);
|
||||
}
|
||||
/** @brief A map-to-unordered_map instrumentation line in the
|
||||
stack table. */
|
||||
class __map2umap_stack_info
|
||||
: public __map2umap_info
|
||||
{
|
||||
public:
|
||||
__map2umap_stack_info(const __map2umap_info& __o)
|
||||
: __map2umap_info(__o) { }
|
||||
};
|
||||
|
||||
inline void __map2umap_info:: __record_erase(size_t __size, size_t __count)
|
||||
{
|
||||
_M_erase += __count;
|
||||
_M_map_cost += __count * __map_erase_cost(__size);
|
||||
_M_umap_cost += (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__umap_erase_cost_factor).__value);
|
||||
}
|
||||
|
||||
inline void __map2umap_info:: __record_find(size_t __size)
|
||||
{
|
||||
_M_find += 1;
|
||||
_M_map_cost += __map_find_cost(__size);
|
||||
_M_umap_cost += _GLIBCXX_PROFILE_DATA(__umap_find_cost_factor).__value;
|
||||
}
|
||||
|
||||
inline void __map2umap_info:: __record_iterate(size_t __count)
|
||||
{
|
||||
_M_iterate += __count;
|
||||
_M_map_cost += (__count
|
||||
* _GLIBCXX_PROFILE_DATA(__map_iterate_cost_factor).__value);
|
||||
_M_umap_cost += (
|
||||
__count * _GLIBCXX_PROFILE_DATA(__umap_iterate_cost_factor).__value);
|
||||
}
|
||||
|
||||
inline void __map2umap_info:: __record_invalidate()
|
||||
{
|
||||
_M_valid = false;
|
||||
}
|
||||
|
||||
inline void __map2umap_info::__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %Zu %.0f %.0f %s\n",
|
||||
_M_insert, _M_erase, _M_find, _M_iterate, _M_map_cost, _M_umap_cost,
|
||||
_M_valid ? "valid" : "invalid");
|
||||
}
|
||||
|
||||
/** @brief A map-to-unordered_map instrumentation line in the stack table. */
|
||||
class __map2umap_stack_info: public __map2umap_info
|
||||
{
|
||||
public:
|
||||
__map2umap_stack_info(const __map2umap_info& o) : __map2umap_info(o) {}
|
||||
};
|
||||
|
||||
/** @brief Map-to-unordered_map instrumentation producer. */
|
||||
class __trace_map2umap
|
||||
: public __trace_base<__map2umap_info, __map2umap_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_map2umap();
|
||||
};
|
||||
|
||||
inline __trace_map2umap::__trace_map2umap()
|
||||
/** @brief Map-to-unordered_map instrumentation producer. */
|
||||
class __trace_map2umap
|
||||
: public __trace_base<__map2umap_info, __map2umap_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_map2umap()
|
||||
: __trace_base<__map2umap_info, __map2umap_stack_info>()
|
||||
{
|
||||
__id = "map-to-unordered-map";
|
||||
}
|
||||
{ __id = "map-to-unordered-map"; }
|
||||
};
|
||||
|
||||
inline void __trace_map_to_unordered_map_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap) = new __trace_map2umap();
|
||||
}
|
||||
inline void
|
||||
__trace_map_to_unordered_map_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_map2umap) = new __trace_map2umap(); }
|
||||
|
||||
inline void __trace_map_to_unordered_map_report(
|
||||
FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_map2umap)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__write(__f);
|
||||
inline void
|
||||
__trace_map_to_unordered_map_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_map2umap))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__write(__f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_map_to_unordered_map_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_map_to_unordered_map_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__add_object(
|
||||
__obj, __map2umap_info(__get_stack()));
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->
|
||||
__add_object(__obj, __map2umap_info(__get_stack()));
|
||||
}
|
||||
|
||||
inline void __trace_map_to_unordered_map_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_map_to_unordered_map_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__retire_object(__obj);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__retire_object(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_map_to_unordered_map_insert(const void* __obj,
|
||||
size_t __size, size_t __count)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_map_to_unordered_map_insert(const void* __obj,
|
||||
size_t __size, size_t __count)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
__map2umap_info* __info =
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
__map2umap_info* __info
|
||||
= _GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
|
||||
if (__info) __info->__record_insert(__size, __count);
|
||||
}
|
||||
if (__info)
|
||||
__info->__record_insert(__size, __count);
|
||||
}
|
||||
|
||||
inline void __trace_map_to_unordered_map_erase(const void* __obj,
|
||||
size_t __size, size_t __count)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_map_to_unordered_map_erase(const void* __obj,
|
||||
size_t __size, size_t __count)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
__map2umap_info* __info =
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
__map2umap_info* __info
|
||||
= _GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
|
||||
if (__info) __info->__record_erase(__size, __count);
|
||||
}
|
||||
if (__info)
|
||||
__info->__record_erase(__size, __count);
|
||||
}
|
||||
|
||||
inline void __trace_map_to_unordered_map_find(const void* __obj, size_t __size)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_map_to_unordered_map_find(const void* __obj, size_t __size)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
__map2umap_info* __info =
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
__map2umap_info* __info
|
||||
= _GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
|
||||
if (__info) __info->__record_find(__size);
|
||||
}
|
||||
if (__info)
|
||||
__info->__record_find(__size);
|
||||
}
|
||||
|
||||
inline void __trace_map_to_unordered_map_iterate(const void* __obj,
|
||||
size_t __count)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_map_to_unordered_map_iterate(const void* __obj, size_t __count)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
__map2umap_info* __info =
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
__map2umap_info* __info
|
||||
= _GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
|
||||
if (__info)
|
||||
__info->__record_iterate(__count);
|
||||
}
|
||||
|
||||
if (__info) __info->__record_iterate(__count);
|
||||
}
|
||||
inline void
|
||||
__trace_map_to_unordered_map_invalidate(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_map_to_unordered_map_invalidate(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
__map2umap_info* __info
|
||||
= _GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
|
||||
__map2umap_info* __info =
|
||||
_GLIBCXX_PROFILE_DATA(_S_map2umap)->__get_object_info(__obj);
|
||||
|
||||
if (__info) __info->__record_invalidate();
|
||||
}
|
||||
if (__info)
|
||||
__info->__record_invalidate();
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_MAP_TO_UNORDERED_MAP_H */
|
||||
|
@ -53,120 +53,125 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
typedef const void* __object_t;
|
||||
typedef void* __instruction_address_t;
|
||||
typedef std::_GLIBCXX_STD_PR::vector<__instruction_address_t> __stack_npt;
|
||||
typedef __stack_npt* __stack_t;
|
||||
typedef const void* __object_t;
|
||||
typedef void* __instruction_address_t;
|
||||
typedef std::_GLIBCXX_STD_PR::vector<__instruction_address_t> __stack_npt;
|
||||
typedef __stack_npt* __stack_t;
|
||||
|
||||
size_t __stack_max_depth();
|
||||
size_t __stack_max_depth();
|
||||
|
||||
inline __stack_t __get_stack()
|
||||
{
|
||||
#if defined _GLIBCXX_HAVE_EXECINFO_H
|
||||
size_t __max_depth = __stack_max_depth();
|
||||
if (__max_depth == 0)
|
||||
return 0;
|
||||
__stack_npt __buffer(__max_depth);
|
||||
int __depth = backtrace(&__buffer[0], __max_depth);
|
||||
__stack_t __stack = new __stack_npt(__depth);
|
||||
memcpy(&(*__stack)[0], &__buffer[0], __depth * sizeof(__object_t));
|
||||
return __stack;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline __size(const __stack_t& __stack)
|
||||
{
|
||||
if (!__stack) {
|
||||
return 0;
|
||||
} else {
|
||||
return __stack->size();
|
||||
}
|
||||
}
|
||||
|
||||
inline void __write(FILE* __f, const __stack_t __stack)
|
||||
{
|
||||
if (!__stack) {
|
||||
return;
|
||||
}
|
||||
|
||||
__stack_npt::const_iterator __it;
|
||||
for (__it = __stack->begin(); __it != __stack->end(); ++__it) {
|
||||
fprintf(__f, "%p ", *__it);
|
||||
}
|
||||
}
|
||||
|
||||
/** @brief Hash function for summary trace using call stack as index. */
|
||||
class __stack_hash
|
||||
{
|
||||
public:
|
||||
size_t operator()(const __stack_t __s) const
|
||||
inline __stack_t
|
||||
__get_stack()
|
||||
{
|
||||
if (!__s) {
|
||||
#if defined _GLIBCXX_HAVE_EXECINFO_H
|
||||
size_t __max_depth = __stack_max_depth();
|
||||
if (__max_depth == 0)
|
||||
return 0;
|
||||
__stack_npt __buffer(__max_depth);
|
||||
int __depth = backtrace(&__buffer[0], __max_depth);
|
||||
__stack_t __stack = new __stack_npt(__depth);
|
||||
memcpy(&(*__stack)[0], &__buffer[0], __depth * sizeof(__object_t));
|
||||
return __stack;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
inline size_t
|
||||
__size(__stack_t __stack)
|
||||
{
|
||||
if (!__stack)
|
||||
return 0;
|
||||
else
|
||||
return __stack->size();
|
||||
}
|
||||
|
||||
// XXX
|
||||
inline void
|
||||
__write(FILE* __f, __stack_t __stack)
|
||||
{
|
||||
if (!__stack)
|
||||
return;
|
||||
|
||||
__stack_npt::const_iterator __it;
|
||||
for (__it = __stack->begin(); __it != __stack->end(); ++__it)
|
||||
fprintf(__f, "%p ", *__it);
|
||||
}
|
||||
|
||||
/** @brief Hash function for summary trace using call stack as index. */
|
||||
class __stack_hash
|
||||
{
|
||||
public:
|
||||
size_t
|
||||
operator()(__stack_t __s) const
|
||||
{
|
||||
if (!__s)
|
||||
return 0;
|
||||
|
||||
uintptr_t __index = 0;
|
||||
__stack_npt::const_iterator __it;
|
||||
for (__it = __s->begin(); __it != __s->end(); ++__it)
|
||||
__index += reinterpret_cast<uintptr_t>(*__it);
|
||||
return __index;
|
||||
}
|
||||
|
||||
uintptr_t __index = 0;
|
||||
__stack_npt::const_iterator __it;
|
||||
for (__it = __s->begin(); __it != __s->end(); ++__it) {
|
||||
__index += reinterpret_cast<uintptr_t>(*__it);
|
||||
}
|
||||
return __index;
|
||||
}
|
||||
bool operator() (__stack_t __stack1, __stack_t __stack2) const
|
||||
{
|
||||
if (!__stack1 && !__stack2)
|
||||
return true;
|
||||
if (!__stack1 || !__stack2)
|
||||
return false;
|
||||
if (__stack1->size() != __stack2->size())
|
||||
return false;
|
||||
|
||||
bool operator() (const __stack_t __stack1, const __stack_t __stack2) const
|
||||
size_t __byte_size = __stack1->size() * sizeof(__stack_npt::value_type);
|
||||
return memcmp(&(*__stack1)[0], &(*__stack2)[0], __byte_size) == 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/** @brief Base class for a line in the object table. */
|
||||
class __object_info_base
|
||||
{
|
||||
if (!__stack1 && !__stack2) return true;
|
||||
if (!__stack1 || !__stack2) return false;
|
||||
if (__stack1->size() != __stack2->size()) return false;
|
||||
public:
|
||||
__object_info_base() { }
|
||||
|
||||
size_t __byte_size = __stack1->size() * sizeof(__stack_npt::value_type);
|
||||
return memcmp(&(*__stack1)[0], &(*__stack2)[0], __byte_size) == 0;
|
||||
}
|
||||
};
|
||||
__object_info_base(__stack_t __stack)
|
||||
: _M_stack(__stack), _M_valid(true) { }
|
||||
|
||||
/** @brief Base class for a line in the object table. */
|
||||
class __object_info_base
|
||||
{
|
||||
public:
|
||||
__object_info_base() {}
|
||||
__object_info_base(__stack_t __stack);
|
||||
__object_info_base(const __object_info_base& o);
|
||||
virtual ~__object_info_base() {}
|
||||
bool __is_valid() const { return _M_valid; }
|
||||
__stack_t __stack() const { return _M_stack; }
|
||||
virtual void __write(FILE* f) const = 0;
|
||||
__object_info_base(const __object_info_base& __o)
|
||||
: _M_stack(__o._M_stack), _M_valid(__o._M_valid) { }
|
||||
|
||||
protected:
|
||||
__stack_t _M_stack;
|
||||
bool _M_valid;
|
||||
};
|
||||
virtual ~__object_info_base() { }
|
||||
|
||||
inline __object_info_base::__object_info_base(__stack_t __stack)
|
||||
{
|
||||
_M_stack = __stack;
|
||||
_M_valid = true;
|
||||
}
|
||||
bool
|
||||
__is_valid() const
|
||||
{ return _M_valid; }
|
||||
|
||||
__stack_t
|
||||
__stack() const
|
||||
{ return _M_stack; }
|
||||
|
||||
virtual void __write(FILE* f) const = 0;
|
||||
|
||||
inline __object_info_base::__object_info_base(const __object_info_base& __o)
|
||||
{
|
||||
_M_stack = __o._M_stack;
|
||||
_M_valid = __o._M_valid;
|
||||
}
|
||||
protected:
|
||||
__stack_t _M_stack;
|
||||
bool _M_valid;
|
||||
};
|
||||
|
||||
/** @brief Base class for a line in the stack table. */
|
||||
template<typename __object_info>
|
||||
class __stack_info_base
|
||||
{
|
||||
public:
|
||||
__stack_info_base() {}
|
||||
__stack_info_base(const __object_info& __info) = 0;
|
||||
virtual ~__stack_info_base() {}
|
||||
void __merge(const __object_info& __info) = 0;
|
||||
virtual float __magnitude() const = 0;
|
||||
virtual const char* __get_id() const = 0;
|
||||
};
|
||||
|
||||
/** @brief Base class for a line in the stack table. */
|
||||
template<typename __object_info>
|
||||
class __stack_info_base
|
||||
{
|
||||
public:
|
||||
__stack_info_base() { }
|
||||
__stack_info_base(const __object_info& __info) = 0;
|
||||
virtual ~__stack_info_base() {}
|
||||
void __merge(const __object_info& __info) = 0;
|
||||
virtual float __magnitude() const = 0;
|
||||
virtual const char* __get_id() const = 0;
|
||||
};
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_NODE_H */
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the terms
|
||||
@ -39,32 +39,35 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
enum __state_type { __ON, __OFF, __INVALID };
|
||||
|
||||
enum __state_type { __ON, __OFF, __INVALID };
|
||||
_GLIBCXX_PROFILE_DEFINE_DATA(__state_type, __state, __INVALID);
|
||||
|
||||
_GLIBCXX_PROFILE_DEFINE_DATA(__state_type, __state, __INVALID);
|
||||
inline bool
|
||||
__turn(__state_type __s)
|
||||
{ return (_GLIBCXX_PROFILE_DATA(__state)
|
||||
== __sync_val_compare_and_swap(&_GLIBCXX_PROFILE_DATA(__state),
|
||||
__INVALID, __s)); }
|
||||
|
||||
inline bool __turn(__state_type __s)
|
||||
{
|
||||
return (_GLIBCXX_PROFILE_DATA(__state)
|
||||
== __sync_val_compare_and_swap(&_GLIBCXX_PROFILE_DATA(__state),
|
||||
__INVALID, __s));
|
||||
}
|
||||
inline bool
|
||||
__turn_on()
|
||||
{ return __turn(__ON); }
|
||||
|
||||
inline bool __turn_on()
|
||||
{ return __turn(__ON); }
|
||||
inline bool
|
||||
__turn_off()
|
||||
{ return __turn(__OFF); }
|
||||
|
||||
inline bool __turn_off()
|
||||
{ return __turn(__OFF); }
|
||||
inline bool
|
||||
__is_on()
|
||||
{ return _GLIBCXX_PROFILE_DATA(__state) == __ON; }
|
||||
|
||||
inline bool __is_on()
|
||||
{ return _GLIBCXX_PROFILE_DATA(__state) == __ON; }
|
||||
inline bool
|
||||
__is_off()
|
||||
{ return _GLIBCXX_PROFILE_DATA(__state) == __OFF; }
|
||||
|
||||
inline bool __is_off()
|
||||
{ return _GLIBCXX_PROFILE_DATA(__state) == __OFF; }
|
||||
|
||||
inline bool __is_invalid()
|
||||
{ return _GLIBCXX_PROFILE_DATA(__state) == __INVALID; }
|
||||
inline bool
|
||||
__is_invalid()
|
||||
{ return _GLIBCXX_PROFILE_DATA(__state) == __INVALID; }
|
||||
|
||||
} // end namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_STATE_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the terms
|
||||
@ -54,50 +54,57 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
/** @brief Hashtable size instrumentation trace producer. */
|
||||
class __trace_vector_size
|
||||
: public __trace_container_size
|
||||
{
|
||||
public:
|
||||
__trace_vector_size()
|
||||
: __trace_container_size()
|
||||
{ __id = "vector-size"; }
|
||||
};
|
||||
|
||||
/** @brief Hashtable size instrumentation trace producer. */
|
||||
class __trace_vector_size : public __trace_container_size
|
||||
{
|
||||
public:
|
||||
__trace_vector_size() : __trace_container_size() { __id = "vector-size"; }
|
||||
};
|
||||
inline void
|
||||
__trace_vector_size_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_vector_size) = new __trace_vector_size(); }
|
||||
|
||||
inline void __trace_vector_size_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size) = new __trace_vector_size();
|
||||
}
|
||||
|
||||
inline void __trace_vector_size_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_vector_size)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__write(__f);
|
||||
inline void
|
||||
__trace_vector_size_report(FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_vector_size))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__write(__f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_vector_size_construct(const void* __obj, size_t __num)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_vector_size_construct(const void* __obj, size_t __num)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__insert(__obj, __get_stack(), __num);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__insert(__obj, __get_stack(),
|
||||
__num);
|
||||
}
|
||||
|
||||
inline void __trace_vector_size_destruct(const void* __obj, size_t __num,
|
||||
size_t __inum)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_vector_size_destruct(const void* __obj, size_t __num, size_t __inum)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__destruct(__obj, __num, __inum);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__destruct(__obj, __num, __inum);
|
||||
}
|
||||
|
||||
inline void __trace_vector_size_resize(const void* __obj, size_t __from,
|
||||
size_t __to)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_vector_size_resize(const void* __obj, size_t __from, size_t __to)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__resize(__obj, __from, __to);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_size)->__resize(__obj, __from, __to);
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// Copyright (C) 2009 Free Software Foundation, Inc.
|
||||
// Copyright (C) 2009, 2010 Free Software Foundation, Inc.
|
||||
//
|
||||
// This file is part of the GNU ISO C++ Library. This library is free
|
||||
// software; you can redistribute it and/or modify it under the terms
|
||||
@ -52,285 +52,305 @@
|
||||
|
||||
namespace __gnu_profile
|
||||
{
|
||||
/** @brief A vector-to-list instrumentation line in the object table. */
|
||||
class __vector2list_info
|
||||
: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__vector2list_info()
|
||||
: _M_shift_count(0), _M_iterate(0), _M_resize(0), _M_list_cost(0),
|
||||
_M_vector_cost(0), _M_valid(true) { }
|
||||
|
||||
/** @brief A vector-to-list instrumentation line in the object table. */
|
||||
class __vector2list_info: public __object_info_base
|
||||
{
|
||||
public:
|
||||
__vector2list_info()
|
||||
:_M_shift_count(0), _M_iterate(0), _M_resize(0), _M_list_cost(0),
|
||||
_M_vector_cost(0), _M_valid(true) {}
|
||||
__vector2list_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
|
||||
_M_resize(0), _M_list_cost(0), _M_vector_cost(0), _M_valid(true) {}
|
||||
virtual ~__vector2list_info() {}
|
||||
__vector2list_info(const __vector2list_info& __o);
|
||||
void __merge(const __vector2list_info& __o);
|
||||
void __write(FILE* __f) const;
|
||||
float __magnitude() const { return _M_vector_cost - _M_list_cost; }
|
||||
const char* __advice() const
|
||||
{ return strdup("change std::vector to std::list"); }
|
||||
__vector2list_info(__stack_t __stack)
|
||||
: __object_info_base(__stack), _M_shift_count(0), _M_iterate(0),
|
||||
_M_resize(0), _M_list_cost(0), _M_vector_cost(0), _M_valid(true) { }
|
||||
|
||||
size_t __shift_count() { return _M_shift_count; }
|
||||
size_t __iterate() { return _M_iterate; }
|
||||
float __list_cost() { return _M_list_cost; }
|
||||
size_t __resize() { return _M_resize; }
|
||||
void __set_list_cost(float __lc) { _M_list_cost = __lc; }
|
||||
void __set_vector_cost(float __vc) { _M_vector_cost = __vc; }
|
||||
bool __is_valid() { return _M_valid; }
|
||||
void __set_invalid() { _M_valid = false; }
|
||||
virtual ~__vector2list_info() { }
|
||||
|
||||
void __opr_insert(size_t __pos, size_t __num);
|
||||
void __opr_iterate(size_t __num);
|
||||
void __resize(size_t __from, size_t __to);
|
||||
void __opr_find(size_t __size);
|
||||
__vector2list_info(const __vector2list_info& __o)
|
||||
: __object_info_base(__o), _M_shift_count(__o._M_shift_count),
|
||||
_M_iterate(__o._M_iterate), _M_resize(__o._M_resize),
|
||||
_M_list_cost(__o._M_list_cost), _M_vector_cost(__o._M_vector_cost),
|
||||
_M_valid(__o._M_valid) { }
|
||||
|
||||
private:
|
||||
size_t _M_shift_count;
|
||||
size_t _M_iterate;
|
||||
size_t _M_resize;
|
||||
float _M_list_cost;
|
||||
float _M_vector_cost;
|
||||
bool _M_valid;
|
||||
};
|
||||
void
|
||||
__merge(const __vector2list_info& __o)
|
||||
{
|
||||
_M_shift_count += __o._M_shift_count;
|
||||
_M_iterate += __o._M_iterate;
|
||||
_M_vector_cost += __o._M_vector_cost;
|
||||
_M_list_cost += __o._M_list_cost;
|
||||
_M_valid &= __o._M_valid;
|
||||
_M_resize += __o._M_resize;
|
||||
}
|
||||
|
||||
inline __vector2list_info::__vector2list_info(const __vector2list_info& __o)
|
||||
: __object_info_base(__o)
|
||||
{
|
||||
_M_shift_count = __o._M_shift_count;
|
||||
_M_iterate = __o._M_iterate;
|
||||
_M_vector_cost = __o._M_vector_cost;
|
||||
_M_list_cost = __o._M_list_cost;
|
||||
_M_valid = __o._M_valid;
|
||||
_M_resize = __o._M_resize;
|
||||
}
|
||||
void
|
||||
__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n", _M_shift_count, _M_resize,
|
||||
_M_iterate, _M_vector_cost, _M_list_cost);
|
||||
}
|
||||
|
||||
inline void __vector2list_info::__merge(const __vector2list_info& __o)
|
||||
{
|
||||
_M_shift_count += __o._M_shift_count;
|
||||
_M_iterate += __o._M_iterate;
|
||||
_M_vector_cost += __o._M_vector_cost;
|
||||
_M_list_cost += __o._M_list_cost;
|
||||
_M_valid &= __o._M_valid;
|
||||
_M_resize += __o._M_resize;
|
||||
}
|
||||
float
|
||||
__magnitude() const
|
||||
{ return _M_vector_cost - _M_list_cost; }
|
||||
|
||||
inline void __vector2list_info::__opr_insert(size_t __pos, size_t __num)
|
||||
{
|
||||
_M_shift_count += __num - __pos;
|
||||
}
|
||||
const char* __advice() const
|
||||
{ return strdup("change std::vector to std::list"); }
|
||||
|
||||
inline void __vector2list_info::__resize(size_t __from, size_t __to)
|
||||
{
|
||||
_M_resize += __from;
|
||||
}
|
||||
size_t
|
||||
__shift_count()
|
||||
{ return _M_shift_count; }
|
||||
|
||||
inline void __vector2list_info::__opr_iterate(size_t __num)
|
||||
{
|
||||
_M_iterate += __num;
|
||||
}
|
||||
size_t
|
||||
__iterate()
|
||||
{ return _M_iterate; }
|
||||
|
||||
inline void __vector2list_info::__opr_find(size_t __size)
|
||||
{
|
||||
// Use average case complexity.
|
||||
_M_iterate += 3.0 / 4.0 * __size;
|
||||
}
|
||||
float __list_cost()
|
||||
{ return _M_list_cost; }
|
||||
|
||||
/** @brief A vector-to-list instrumentation line in the stack table. */
|
||||
class __vector2list_stack_info: public __vector2list_info {
|
||||
public:
|
||||
__vector2list_stack_info(const __vector2list_info& __o)
|
||||
: __vector2list_info(__o) {}
|
||||
};
|
||||
size_t
|
||||
__resize()
|
||||
{ return _M_resize; }
|
||||
|
||||
/** @brief Vector-to-list instrumentation producer. */
|
||||
class __trace_vector_to_list
|
||||
: public __trace_base<__vector2list_info, __vector2list_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_vector_to_list();
|
||||
~__trace_vector_to_list() {}
|
||||
void
|
||||
__set_list_cost(float __lc)
|
||||
{ _M_list_cost = __lc; }
|
||||
|
||||
void
|
||||
__set_vector_cost(float __vc)
|
||||
{ _M_vector_cost = __vc; }
|
||||
|
||||
bool
|
||||
__is_valid()
|
||||
{ return _M_valid; }
|
||||
|
||||
void
|
||||
__set_invalid()
|
||||
{ _M_valid = false; }
|
||||
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void __insert(__object_t __obj, __stack_t __stack);
|
||||
// Call at destruction/clean to set container final size.
|
||||
void __destruct(const void* __obj);
|
||||
void
|
||||
__opr_insert(size_t __pos, size_t __num)
|
||||
{ _M_shift_count += __num - __pos; }
|
||||
|
||||
// Find the node in the live map.
|
||||
__vector2list_info* __find(const void* __obj);
|
||||
void
|
||||
__opr_iterate(size_t __num)
|
||||
{ _M_iterate += __num; }
|
||||
|
||||
// Collect cost of operations.
|
||||
void __opr_insert(const void* __obj, size_t __pos, size_t __num);
|
||||
void __opr_iterate(const void* __obj, size_t __num);
|
||||
void __invalid_operator(const void* __obj);
|
||||
void __resize(const void* __obj, size_t __from, size_t __to);
|
||||
float __vector_cost(size_t __shift, size_t __iterate, size_t __resize);
|
||||
float __list_cost(size_t __shift, size_t __iterate, size_t __resize);
|
||||
void __opr_find(const void* __obj, size_t __size);
|
||||
};
|
||||
void
|
||||
__resize(size_t __from, size_t)
|
||||
{ _M_resize += __from; }
|
||||
|
||||
inline __trace_vector_to_list::__trace_vector_to_list()
|
||||
void __opr_find(size_t __size)
|
||||
{
|
||||
// Use average case complexity.
|
||||
_M_iterate += 3.0 / 4.0 * __size;
|
||||
}
|
||||
|
||||
private:
|
||||
size_t _M_shift_count;
|
||||
size_t _M_iterate;
|
||||
size_t _M_resize;
|
||||
float _M_list_cost;
|
||||
float _M_vector_cost;
|
||||
bool _M_valid;
|
||||
};
|
||||
|
||||
|
||||
/** @brief A vector-to-list instrumentation line in the stack table. */
|
||||
class __vector2list_stack_info
|
||||
: public __vector2list_info
|
||||
{
|
||||
public:
|
||||
__vector2list_stack_info(const __vector2list_info& __o)
|
||||
: __vector2list_info(__o) { }
|
||||
};
|
||||
|
||||
|
||||
/** @brief Vector-to-list instrumentation producer. */
|
||||
class __trace_vector_to_list
|
||||
: public __trace_base<__vector2list_info, __vector2list_stack_info>
|
||||
{
|
||||
public:
|
||||
__trace_vector_to_list()
|
||||
: __trace_base<__vector2list_info, __vector2list_stack_info>()
|
||||
{
|
||||
__id = "vector-to-list";
|
||||
}
|
||||
{ __id = "vector-to-list"; }
|
||||
|
||||
inline void __trace_vector_to_list::__insert(__object_t __obj,
|
||||
__stack_t __stack)
|
||||
{
|
||||
__add_object(__obj, __vector2list_info(__stack));
|
||||
}
|
||||
~__trace_vector_to_list() { }
|
||||
|
||||
inline void __vector2list_info::__write(FILE* __f) const
|
||||
{
|
||||
fprintf(__f, "%Zu %Zu %Zu %.0f %.0f\n",
|
||||
_M_shift_count, _M_resize, _M_iterate, _M_vector_cost, _M_list_cost);
|
||||
}
|
||||
// Insert a new node at construct with object, callstack and initial size.
|
||||
void
|
||||
__insert(__object_t __obj, __stack_t __stack)
|
||||
{ __add_object(__obj, __vector2list_info(__stack)); }
|
||||
|
||||
inline float __trace_vector_to_list::__vector_cost(size_t __shift,
|
||||
size_t __iterate,
|
||||
size_t __resize)
|
||||
{
|
||||
return (
|
||||
__shift * _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value
|
||||
+ __iterate * _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value
|
||||
+ __resize * _GLIBCXX_PROFILE_DATA(__vector_resize_cost_factor).__value
|
||||
);
|
||||
}
|
||||
// Call at destruction/clean to set container final size.
|
||||
void
|
||||
__destruct(const void* __obj)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
|
||||
inline float __trace_vector_to_list::__list_cost(size_t __shift,
|
||||
size_t __iterate,
|
||||
size_t __resize)
|
||||
{
|
||||
return (
|
||||
__shift * _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value
|
||||
+ __iterate * _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value
|
||||
+ __resize * _GLIBCXX_PROFILE_DATA(__list_resize_cost_factor).__value);
|
||||
}
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (!__res)
|
||||
return;
|
||||
|
||||
inline void __trace_vector_to_list::__destruct(const void* __obj)
|
||||
{
|
||||
if (!__is_on())
|
||||
return;
|
||||
float __vc = __vector_cost(__res->__shift_count(), __res->__iterate(),
|
||||
__res->__resize());
|
||||
float __lc = __list_cost(__res->__shift_count(), __res->__iterate(),
|
||||
__res->__resize());
|
||||
__res->__set_vector_cost(__vc);
|
||||
__res->__set_list_cost(__lc);
|
||||
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (!__res)
|
||||
return;
|
||||
__retire_object(__obj);
|
||||
}
|
||||
|
||||
float __vc = __vector_cost(__res->__shift_count(), __res->__iterate(),
|
||||
__res->__resize());
|
||||
float __lc = __list_cost(__res->__shift_count(), __res->__iterate(),
|
||||
__res->__resize());
|
||||
__res->__set_vector_cost(__vc);
|
||||
__res->__set_list_cost(__lc);
|
||||
// Find the node in the live map.
|
||||
// XXX Undefined?!?
|
||||
__vector2list_info* __find(const void* __obj);
|
||||
|
||||
__retire_object(__obj);
|
||||
}
|
||||
// Collect cost of operations.
|
||||
void
|
||||
__opr_insert(const void* __obj, size_t __pos, size_t __num)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_insert(__pos, __num);
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list::__opr_insert(const void* __obj,
|
||||
size_t __pos, size_t __num)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_insert(__pos, __num);
|
||||
}
|
||||
void
|
||||
__opr_iterate(const void* __obj, size_t __num)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_iterate(__num);
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list::__opr_iterate(const void* __obj,
|
||||
size_t __num)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_iterate(__num);
|
||||
}
|
||||
void
|
||||
__invalid_operator(const void* __obj)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__set_invalid();
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list::__invalid_operator(const void* __obj)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__set_invalid();
|
||||
}
|
||||
void
|
||||
__resize(const void* __obj, size_t __from, size_t __to)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__resize(__from, __to);
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list::__resize(const void* __obj, size_t __from,
|
||||
size_t __to)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__resize(__from, __to);
|
||||
}
|
||||
float
|
||||
__vector_cost(size_t __shift, size_t __iterate, size_t __resize)
|
||||
{
|
||||
return (__shift
|
||||
* _GLIBCXX_PROFILE_DATA(__vector_shift_cost_factor).__value
|
||||
+ __iterate
|
||||
* _GLIBCXX_PROFILE_DATA(__vector_iterate_cost_factor).__value
|
||||
+ __resize
|
||||
* _GLIBCXX_PROFILE_DATA(__vector_resize_cost_factor).__value);
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list::__opr_find(const void* __obj,
|
||||
size_t __size)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_find(__size);
|
||||
}
|
||||
float
|
||||
__list_cost(size_t __shift, size_t __iterate, size_t __resize)
|
||||
{
|
||||
return (__shift
|
||||
* _GLIBCXX_PROFILE_DATA(__list_shift_cost_factor).__value
|
||||
+ __iterate
|
||||
* _GLIBCXX_PROFILE_DATA(__list_iterate_cost_factor).__value
|
||||
+ __resize
|
||||
* _GLIBCXX_PROFILE_DATA(__list_resize_cost_factor).__value);
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list_init()
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list) = new __trace_vector_to_list();
|
||||
}
|
||||
void
|
||||
__opr_find(const void* __obj, size_t __size)
|
||||
{
|
||||
__vector2list_info* __res = __get_object_info(__obj);
|
||||
if (__res)
|
||||
__res->__opr_find(__size);
|
||||
}
|
||||
};
|
||||
|
||||
inline void __trace_vector_to_list_report(FILE* __f,
|
||||
__warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_vector_to_list)) {
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__write(__f);
|
||||
|
||||
inline void
|
||||
__trace_vector_to_list_init()
|
||||
{ _GLIBCXX_PROFILE_DATA(_S_vector_to_list) = new __trace_vector_to_list(); }
|
||||
|
||||
inline void
|
||||
__trace_vector_to_list_report(FILE* __f, __warning_vector_t& __warnings)
|
||||
{
|
||||
if (_GLIBCXX_PROFILE_DATA(_S_vector_to_list))
|
||||
{
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->
|
||||
__collect_warnings(__warnings);
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__write(__f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_vector_to_list_construct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__insert(__obj, __get_stack());
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__insert(__obj, __get_stack());
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_vector_to_list_destruct(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__destruct(__obj);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__destruct(__obj);
|
||||
}
|
||||
|
||||
inline void __trace_vector_to_list_insert(const void* __obj,
|
||||
size_t __pos, size_t __num)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
inline void
|
||||
__trace_vector_to_list_insert(const void* __obj, size_t __pos, size_t __num)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_insert(__obj, __pos, __num);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_insert(__obj, __pos,
|
||||
__num);
|
||||
}
|
||||
|
||||
inline void
|
||||
__trace_vector_to_list_iterate(const void* __obj, size_t __num = 1)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_vector_to_list_iterate(const void* __obj, size_t __num = 1)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_iterate(__obj, __num);
|
||||
}
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_iterate(__obj, __num);
|
||||
}
|
||||
inline void
|
||||
__trace_vector_to_list_invalid_operator(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_vector_to_list_invalid_operator(const void* __obj)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__invalid_operator(__obj);
|
||||
}
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__invalid_operator(__obj);
|
||||
}
|
||||
inline void
|
||||
__trace_vector_to_list_resize(const void* __obj, size_t __from, size_t __to)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_vector_to_list_resize(const void* __obj,
|
||||
size_t __from, size_t __to)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__resize(__obj, __from, __to);
|
||||
}
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__resize(__obj, __from, __to);
|
||||
}
|
||||
inline void
|
||||
__trace_vector_to_list_find(const void* __obj, size_t __size)
|
||||
{
|
||||
if (!__profcxx_init())
|
||||
return;
|
||||
|
||||
inline void __trace_vector_to_list_find(const void* __obj, size_t __size)
|
||||
{
|
||||
if (!__profcxx_init()) return;
|
||||
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_find(__obj, __size);
|
||||
}
|
||||
_GLIBCXX_PROFILE_DATA(_S_vector_to_list)->__opr_find(__obj, __size);
|
||||
}
|
||||
|
||||
} // namespace __gnu_profile
|
||||
#endif /* _GLIBCXX_PROFILE_PROFILER_VECTOR_TO_LIST_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user