Google::HeapProfiler Class Reference

Auditor based on the Google Heap Profiler. More...

#include <GoogleAuditor.cpp>

Inheritance diagram for Google::HeapProfiler:
Collaboration diagram for Google::HeapProfiler:

Public Member Functions

 HeapProfiler (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor. More...
 
- Public Member Functions inherited from Google::AuditorBase
 AuditorBase (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor. More...
 
virtual ~AuditorBase ()
 Destructor. More...
 
StatusCode initialize ()
 Initialize the auditor base. More...
 
StatusCode finalize ()
 Finalize the auditor base. More...
 
void handle (const Incident &incident)
 Implement the handle method for the Incident service. More...
 
void before (StandardEventType type, INamedInterface *i)
 
void before (CustomEventTypeRef type, INamedInterface *i)
 
void before (StandardEventType type, const std::string &s)
 
void before (CustomEventTypeRef type, const std::string &s)
 
void after (StandardEventType type, INamedInterface *i, const StatusCode &sc)
 
void after (CustomEventTypeRef type, INamedInterface *i, const StatusCode &sc)
 
void after (StandardEventType type, const std::string &s, const StatusCode &sc)
 
void after (CustomEventTypeRef type, const std::string &s, const StatusCode &)
 
void beforeInitialize (INamedInterface *i)
 
void beforeReinitialize (INamedInterface *i)
 
void beforeExecute (INamedInterface *i)
 
void beforeBeginRun (INamedInterface *i)
 
void beforeEndRun (INamedInterface *i)
 
void beforeFinalize (INamedInterface *i)
 
void afterInitialize (INamedInterface *i)
 
void afterReinitialize (INamedInterface *i)
 
void afterExecute (INamedInterface *i, const StatusCode &s)
 
void afterBeginRun (INamedInterface *i)
 
void afterEndRun (INamedInterface *i)
 
void afterFinalize (INamedInterface *i)
 
- Public Member Functions inherited from extends< BASE, Interfaces >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

void google_before (const std::string &s)
 Start the google tool. More...
 
void google_after (const std::string &s)
 stop the google tool More...
 
bool alreadyRunning ()
 check if we are already running the tool More...
 

Private Attributes

bool m_dumpProfileHeaps
 
bool m_printProfilesToLog
 

Additional Inherited Members

- Public Types inherited from extends< BASE, Interfaces >
typedef extends base_class
 Typedef to this class. More...
 
typedef extend_interfaces< Interfaces...> extend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extends base_class
 Typedef to this class. More...
 
typedef extend_interfaces< Interfaces...> extend_interfaces_base
 Typedef to the base of this class. More...
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 
- Protected Attributes inherited from Google::AuditorBase
MsgStream m_log
 Messaging object. More...
 

Detailed Description

Auditor based on the Google Heap Profiler.

See

http://google-perftools.googlecode.com/svn/trunk/doc/heapprofile.html

For more details.

Author
Chris Jones
Date
18/04/2011

Definition at line 364 of file GoogleAuditor.cpp.

Constructor & Destructor Documentation

Google::HeapProfiler::HeapProfiler ( const std::string &  name,
ISvcLocator pSvcLocator 
)
inline

Constructor.

Definition at line 370 of file GoogleAuditor.cpp.

371  : AuditorBase( name, pSvcLocator )
372  {
373  declareProperty( "DumpHeapProfiles", m_dumpProfileHeaps = true );
374  declareProperty( "PrintProfilesToLog", m_printProfilesToLog = false );
375  }
AuditorBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.

Member Function Documentation

bool Google::HeapProfiler::alreadyRunning ( )
inlineprotectedvirtual

check if we are already running the tool

Implements Google::AuditorBase.

Definition at line 399 of file GoogleAuditor.cpp.

399 { return IsHeapProfilerRunning(); }
void Google::HeapProfiler::google_after ( const std::string &  s)
inlineprotectedvirtual

stop the google tool

Implements Google::AuditorBase.

Definition at line 384 of file GoogleAuditor.cpp.

385  {
386  if ( m_dumpProfileHeaps )
387  {
388  HeapProfilerDump(s.c_str());
389  }
390  if ( m_printProfilesToLog )
391  {
392  const char * profile = GetHeapProfile();
393  m_log << MSG::INFO << profile << endmsg;
394  delete profile;
395  }
396  HeapProfilerStop();
397  }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
string s
Definition: gaudirun.py:246
MsgStream m_log
Messaging object.
void Google::HeapProfiler::google_before ( const std::string &  s)
inlineprotectedvirtual

Start the google tool.

Implements Google::AuditorBase.

Definition at line 379 of file GoogleAuditor.cpp.

380  {
381  HeapProfilerStart(s.c_str());
382  }
string s
Definition: gaudirun.py:246

Member Data Documentation

bool Google::HeapProfiler::m_dumpProfileHeaps
private

Definition at line 403 of file GoogleAuditor.cpp.

bool Google::HeapProfiler::m_printProfilesToLog
private

Definition at line 404 of file GoogleAuditor.cpp.


The documentation for this class was generated from the following file: