30 #ifndef _GLIBCXX_PROFILE_PROFILER_NODE_H 31 #define _GLIBCXX_PROFILE_PROFILER_NODE_H 1 36 #if defined _GLIBCXX_HAVE_EXECINFO_H 42 typedef void* __instruction_address_t;
43 typedef std::_GLIBCXX_STD_C::vector<__instruction_address_t> __stack_npt;
44 typedef __stack_npt* __stack_t;
46 std::size_t __stack_max_depth();
51 #if defined _GLIBCXX_HAVE_EXECINFO_H 54 std::size_t __max_depth = __stack_max_depth();
57 __stack_npt __buffer(__max_depth);
58 int __depth = backtrace(&__buffer[0], __max_depth);
59 return new(std::nothrow) __stack_npt(__buffer.begin(),
60 __buffer.begin() + __depth);
72 __size(__stack_t __stack)
77 return __stack->size();
82 __write(FILE* __f, __stack_t __stack)
87 __stack_npt::const_iterator __it;
88 for (__it = __stack->begin(); __it != __stack->end(); ++__it)
89 std::fprintf(__f,
"%p ", *__it);
97 operator()(__stack_t __s)
const 102 std::size_t __index = 0;
103 __stack_npt::const_iterator __it;
104 for (__it = __s->begin(); __it != __s->end(); ++__it)
105 __index += reinterpret_cast<std::size_t>(*__it);
109 bool operator() (__stack_t __stack1, __stack_t __stack2)
const 111 if (!__stack1 && !__stack2)
113 if (!__stack1 || !__stack2)
115 if (__stack1->size() != __stack2->size())
118 std::size_t __byte_size
119 = __stack1->size() *
sizeof(__stack_npt::value_type);
120 return __builtin_memcmp(&(*__stack1)[0], &(*__stack2)[0],
131 : _M_stack(__stack), _M_valid(
true) { }
139 { _M_valid =
false; }
143 { _M_valid &= __o._M_valid; }
GNU profile code for public use.
Base class for a line in the object table.
Hash function for summary trace using call stack as index.