[bind10-dev] profiling bind10 and b10-auth

Jeremy C. Reed jreed at isc.org
Tue Mar 9 23:35:44 UTC 2010


I built libdns, auth, etc with -pg and linked with -pg.

The profiling gmon.out is not saved unless executable exits on 
its own. So I patched src/bin/auth/main.cc to handle "shutdown" and do a 
exit(1).

I did 2000 queries.

http://bind10.isc.org/~jreed/gprof.out

A small part of that profiling is:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           

 time   seconds   seconds    calls  us/call  us/call  name    

  7.69      0.01     0.01  5755117     0.00     0.00  
__gnu_cxx::__normal_iterator<unsigned char const*, 
std::vector<unsigned char, std::allocator<unsigned char> > 
>::__normal_iterator(unsigned char const* const&)
  7.69      0.02     0.01  2869559     0.00     0.01  
std::vector<unsigned char, std::allocator<unsigned char> 
>::begin() const
  7.69      0.03     0.01  1372057     0.01     0.01  
__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned 
char, std::allocator<unsigned char> > >::operator+(long const&) const
  7.69      0.04     0.01  1324060     0.01     0.02  
std::vector<unsigned char, std::allocator<unsigned char> 
>::operator[](unsigned long) const
  7.69      0.05     0.01    94048     0.11     0.11  
std::_Vector_base<unsigned char, std::allocator<unsigned char> 
>::_M_deallocate(unsigned char*, unsigned long)
  7.69      0.06     0.01    61335     0.16     0.16  
std::allocator<boost::shared_ptr<isc::dns::RRset> 
>::allocator(std::allocator<boost::shared_ptr<isc::dns::RRset> > const&)
  7.69      0.07     0.01    32026     0.31     0.31  
__gnu_cxx::new_allocator<boost::shared_ptr<isc::dns::rdata::Rdata const> 
>::~new_allocator()

  7.69      0.08     0.01    27417     0.36     0.36  
bool 
std::lexicographical_compare<__gnu_cxx::__normal_iterator<char 
const*, std::string>, __gnu_cxx::__normal_iterator<char 
const*, std::string>, bool (*)(char, 
char)>(__gnu_cxx::__normal_iterator<char const*, 
std::string>, __gnu_cxx::__normal_iterator<char const*, 
std::string>, __gnu_cxx::__normal_iterator<char const*, 
std::string>, __gnu_cxx::__normal_iterator<char const*, 
std::string>, bool (*)(char, char))
  7.69      0.09     0.01    22002     0.45     2.07  
isc::dns::MessageRenderer::MessageRenderer(isc::dns::OutputBuffer&)
  7.69      0.10     0.01    15999     0.63     0.63  
isc::dns::Name::Name()
  7.69      0.11     0.01     2000     5.00     5.01  
isc::dns::MessageRenderer::clear()
  7.69      0.12     0.01     2000     5.00    10.17  
isc::auth::Query::Query(isc::dns::Message&, 
bool)
  3.85      0.13     0.01     2000     
2.50     2.50  
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask>&, 
boost::shared_ptr<isc::auth::QueryTask>*> 
std::uninitialized_copy<std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask> 
const&, 
boost::shared_ptr<isc::auth::QueryTask> 
const*>, 
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask>&, 
boost::shared_ptr<isc::auth::QueryTask>*> 
>(std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask> 
const&, 
boost::shared_ptr<isc::auth::QueryTask> 
const*>, 
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask> 
const&, 
boost::shared_ptr<isc::auth::QueryTask> 
const*>, std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask>&, 
boost::shared_ptr<isc::auth::QueryTask>*>)
  3.85      0.13     0.01     2000   
  2.50     5.00  
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask>&, 
boost::shared_ptr<isc::auth::QueryTask>*> 
std::__uninitialized_copy_a<std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask> 
const&, 
boost::shared_ptr<isc::auth::QueryTask> 
const*>, 
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask>&, 
boost::shared_ptr<isc::auth::QueryTask>*>, 
boost::shared_ptr<isc::auth::QueryTask> 
>(std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask> 
const&, 
boost::shared_ptr<isc::auth::QueryTask> 
const*>, 
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask> 
const&, boost::shared_ptr<isc::auth::QueryTask> const*>, 
std::_Deque_iterator<boost::shared_ptr<isc::auth::QueryTask>, 
boost::shared_ptr<isc::auth::QueryTask>&, 
boost::shared_ptr<isc::auth::QueryTask>*>, 
std::allocator<boost::shared_ptr<isc::auth::QueryTask> >)
  0.00      0.13     0.00  3160326     0.00     0.00  
__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned 
char, std::allocator<unsigned char> > >::base() const
  0.00      0.13     0.00  1487469     0.00     0.00  
__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned 
char, std::allocator<unsigned char> > >::difference_type 
__gnu_cxx::operator-<unsigned char const*, unsigned char const*, 
std::vector<unsigned char, std::allocator<unsigned char> > 
>(__gnu_cxx::__normal_iterator<unsigned char const*, 
std::vector<unsigned char, std::allocator<unsigned char> > > const&, 
__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned 
char, std::allocator<unsigned char> > > const&)
  0.00      0.13     0.00  1478149     0.00     0.00  
std::vector<unsigned char, std::allocator<unsigned char> >::end() const
  0.00      0.13     0.00  1452117     0.00     0.01  
std::vector<unsigned char, std::allocator<unsigned char> >::size() const
  0.00      0.13     0.00  1374723     0.00     0.00  
__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned 
char, std::allocator<unsigned char> > >::operator*() const
  0.00      0.13     0.00  1279394     0.00     0.03  
isc::dns::OutputBuffer::operator[](unsigned long) const

 (first 25 lines)

                     Call graph (explanation follows)


granularity: each sample hit covers 2 byte(s) for 7.69% of 0.13 seconds

index % time    self  children    called     name
                                                 <spontaneous>
[1]    100.0    0.00    0.13                 main [1]
                0.00    0.13    2000/2000        
AuthSrv::processMessage(int) [2]
                0.00    0.00       1/1           
isc::config::ModuleCCSession::ModuleCCSession(std::string, 
boost::shared_ptr<isc::data::Element> 
(*)(boost::shared_ptr<isc::data::Element>), 
boost::shared_ptr<isc::data::Element> (*)(std::string const&, 
boost::shared_ptr<isc::data::Element>)) [151]
                0.00    0.00       1/1           AuthSrv::AuthSrv() 
[156]
                0.00    0.00       1/1           
isc::config::ModuleCCSession::check_command() [177]
                0.00    0.00       2/2           getSocket(int, char 
const*) [1331]
                0.00    0.00       2/2           int const& 
std::max<int>(int const&, int const&) [1474]
                0.00    0.00       1/2           std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > std::operator+<char, 
std::char_traits<char>, std::allocator<char> >(std::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&, char const*) 
[1476]
                0.00    0.00       1/1           
isc::config::ModuleCCSession::getSocket() [1577]
-----------------------------------------------
                0.00    0.13    2000/2000        main [1]
[2]     99.9    0.00    0.13    2000         
AuthSrv::processMessage(int) [2]
                0.00    0.05    2000/2000        
isc::dns::Message::toWire(isc::dns::MessageRenderer&) [3]
                0.00    0.04    2000/2000        
isc::auth::DataSrc::doQuery(isc::auth::Query&) [7]
                0.01    0.01    2000/2000        
isc::auth::Query::Query(isc::dns::Message&, bool) [16]
                0.00    0.01    2000/2000        
isc::dns::MessageRenderer::~MessageRenderer() [23]
                0.00    0.00    2000/2000        
isc::dns::Message::~Message() [69]
                0.00    0.00    2000/2000        
isc::dns::Message::Message(isc::dns::Message::Mode) [72]
                0.00    0.00    2000/2000        
isc::dns::Message::makeResponse() [80]
                0.00    0.00    2000/2000        
isc::dns::Message::fromWire(isc::dns::InputBuffer&) [86]
                0.00    0.00    2000/2000        
isc::dns::MessageRenderer::MessageRenderer(isc::dns::OutputBuffer&) 
[120]
                0.00    0.00    2000/4667        
isc::dns::OutputBuffer::OutputBuffer(unsigned long) [105]
                0.00    0.00    2000/4667        
isc::dns::OutputBuffer::~OutputBuffer() [107]
                0.00    0.00    2000/12668       
isc::dns::OutputBuffer::getData() const [118]
                0.00    0.00    2000/80007       
isc::dns::OutputBuffer::getLength() const [106]
                0.00    0.00    2000/2000        
isc::dns::InputBuffer::InputBuffer(void const*, unsigned long) [800]
                0.00    0.00    2000/12000       
isc::dns::Section::QUESTION() [515]
                0.00    0.00    2000/20000       
isc::dns::Message::getRRCount(isc::dns::Section const&) const [446]
                0.00    0.00    2000/2000        
isc::dns::Message::isDNSSECSupported() const [834]
                0.00    0.00    2000/2000        
isc::dns::Message::getUDPSize() const [832]
                0.00    0.00    2000/6000        
isc::dns::MessageFlag::AA() [630]
                0.00    0.00    2000/6001        
isc::dns::Rcode::NOERROR() [629]
                0.00    0.00    2000/6000        
isc::dns::Message::setHeaderFlag(isc::dns::MessageFlag const&) [632]
                0.00    0.00    2000/2000        
isc::dns::Message::setDNSSECSupported(bool) [806]
                0.00    0.00    2000/2000        
isc::dns::Message::setRcode(isc::dns::Rcode const&) [807]
                0.00    0.00    2000/2000        
isc::dns::Message::setUDPSize(unsigned short) [804]
                0.00    0.00    2000/2000        
isc::dns::MessageRenderer::setLengthLimit(unsigned long) [801]
                0.00    0.00    2000/2000        
isc::auth::Query::~Query() [810]
-----------------------------------------------
                0.00    0.05    2000/2000        
AuthSrv::processMessage(int) [2]

(first couple)


Is this useful?



More information about the bind10-dev mailing list