Google::AuditorBase Class Referenceabstract

Base for Google Auditors. More...

#include <GoogleAuditor.cpp>

Inheritance diagram for Google::AuditorBase:
Collaboration diagram for Google::AuditorBase:

Public Member Functions

 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)
 The following methods are meant to be implemented by the child class... More...
 
void before (CustomEventTypeRef type, INamedInterface *i)
 Audit the start of a custom "event". More...
 
void before (StandardEventType type, const std::string &s)
 Audit the start of a standard "event" for callers that do not implement INamedInterface. More...
 
void before (CustomEventTypeRef type, const std::string &s)
 Audit the start of a custom "event" for callers that do not implement INamedInterface. More...
 
void after (StandardEventType type, INamedInterface *i, const StatusCode &sc)
 Audit the end of a standard "event". More...
 
void after (CustomEventTypeRef type, INamedInterface *i, const StatusCode &sc)
 Audit the end of a custom "event". More...
 
void after (StandardEventType type, const std::string &s, const StatusCode &sc)
 Audit the end of a standard "event" for callers that do not implement INamedInterface. More...
 
void after (CustomEventTypeRef type, const std::string &s, const StatusCode &)
 Audit the end of a custom "event" for callers that do not implement INamedInterface. More...
 
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 extends1< Auditor, IIncidentListener >
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
 extends1 (A1 a1, A2 a2, A3 a3)
 Templated constructor with 3 arguments. More...
 
 extends1 (A1 a1, A2 a2)
 Templated constructor with 2 arguments. More...
 
 extends1 (A1 a1)
 Templated constructor with 1 argument. More...
 
 extends1 ()
 Default constructor. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual void * i_cast (const InterfaceID &tid) const
 Implementation of IInterface::i_cast. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual StatusCode queryInterface (const InterfaceID &ti, void **pp)
 Implementation of IInterface::queryInterface. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
virtual ~extends1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Auditor
 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor. More...
 
virtual ~Auditor ()
 Destructor. More...
 
StatusCode sysInitialize ()
 Initialization method invoked by the framework. More...
 
StatusCode sysFinalize ()
 Finalization method invoked by the framework. More...
 
virtual const std::string & name () const
 Retrieve the name of the instance. More...
 
virtual bool isEnabled () const
 Tell if the auditor is enabled or not. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
int outputLevel () const
 Retrieve the output level of current auditor. More...
 
void setOutputLevel (int level)
 Set the output level for current auditor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
template<class T >
StatusCode service (const std::string &name, T *&svc, bool createIf=false) const
 Access a service by name, creating it if it doesn't already exist. More...
 
virtual StatusCode setProperty (const Property &p)
 Set a value of a property of an auditor. More...
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the value of a property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const
 Get all properties. More...
 
virtual bool hasProperty (const std::string &name) const
 Implementation of IProperty::hasProperty. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setProperties ()
 Set the auditor's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor. More...
 
virtual ~Auditor ()
 Destructor. More...
 
StatusCode sysInitialize ()
 Initialization method invoked by the framework. More...
 
StatusCode sysFinalize ()
 Finalization method invoked by the framework. More...
 
virtual const std::string & name () const
 Retrieve the name of the instance. More...
 
virtual bool isEnabled () const
 Tell if the auditor is enabled or not. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
int outputLevel () const
 Retrieve the output level of current auditor. More...
 
void setOutputLevel (int level)
 Set the output level for current auditor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const
 The standard service locator. More...
 
template<class T >
StatusCode service (const std::string &name, T *&svc, bool createIf=false) const
 Access a service by name, creating it if it doesn't already exist. More...
 
virtual StatusCode setProperty (const Property &p)
 Set a value of a property of an auditor. More...
 
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...
 
virtual StatusCode getProperty (Property *p) const
 Get the value of a property. More...
 
virtual const PropertygetProperty (const std::string &name) const
 Get the property by name. More...
 
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const
 Get all properties. More...
 
virtual bool hasProperty (const std::string &name) const
 Implementation of IProperty::hasProperty. More...
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setProperties ()
 Set the auditor's properties. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
- Public Member Functions inherited from extend_interfaces2< IAuditor, IProperty >
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces2 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IAuditor
 DeclareInterfaceID (IAuditor, 3, 0)
 InterfaceID. More...
 
 DeclareInterfaceID (IAuditor, 3, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from INamedInterface
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
 DeclareInterfaceID (INamedInterface, 1, 0)
 InterfaceID. More...
 
virtual ~INamedInterface ()
 Virtual destructor (always needed for abstract classes). More...
 
- Public Member Functions inherited from IInterface
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
virtual unsigned long addRef ()=0
 Increment the reference count of Interface instance. More...
 
virtual unsigned long release ()=0
 Release Interface instance. More...
 
virtual unsigned long refCount () const =0
 Current reference count. More...
 
virtual ~IInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
 DeclareInterfaceID (IProperty, 2, 1)
 InterfaceID. More...
 
- Public Member Functions inherited from extend_interfaces1< IIncidentListener >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IIncidentListener
 DeclareInterfaceID (IIncidentListener, 2, 0)
 InterfaceID. More...
 
 DeclareInterfaceID (IIncidentListener, 2, 0)
 InterfaceID. More...
 

Protected Member Functions

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

Protected Attributes

MsgStream m_log
 Messaging object. More...
 

Private Member Functions

void startAudit ()
 Start a full event audit. More...
 
void stopAudit ()
 stop a full event audit More...
 
bool isSequencer (INamedInterface *i) const
 Check if the component in question is a GaudiSequencer or a Sequencer. More...
 
bool isPhaseEnabled (const CustomEventTypeRef &type) const
 Check if auditing is enabled for the current processing phase. More...
 
bool isComponentEnabled (const std::string &name) const
 Check if auditing is enabled for the given component. More...
 
std::string getDumpName (const CustomEventTypeRef &type, const std::string &name) const
 

Private Attributes

std::vector< std::string > m_when
 When to audit the algorithms. More...
 
std::vector< std::string > m_veto
 Veto list. Any component in this list will not be audited. More...
 
std::vector< std::string > m_list
 Any component in this list will be audited. If empty, all will be done. More...
 
unsigned long long m_eventsToSkip
 Number of events to skip before auditing. More...
 
bool m_skipSequencers
 Boolean indicating if sequencers should be skipped or not. More...
 
int m_freq
 The frequency to audit events. -1 means all events. More...
 
bool m_audit
 Internal flag to say if auditing is enabled or not for the current event. More...
 
unsigned long long m_nEvts
 Number of events processed. More...
 
bool m_fullEventAudit
 Flag to indicate if full event auditing is enabled or not. More...
 
unsigned long long m_nSampleEvents
 Number of events to include in a full event audit. More...
 
unsigned long long m_sampleEventCount
 Internal count of the number of events currently processed during an audit. More...
 
bool m_inFullAudit
 Internal flag to indicate if we are current in a full event audit. More...
 
std::string m_startedBy
 Name of the component we are currently auditing. More...
 

Additional Inherited Members

- Public Types inherited from extends1< Auditor, IIncidentListener >
typedef extends1 base_class
 Typedef to this class. More...
 
typedef extends1 base_class
 Typedef to this class. More...
 
typedef extend_interfaces1< IIncidentListenerextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces1< IIncidentListenerextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from Auditor
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > Factory
 
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from implements2< IAuditor, IProperty >
typedef implements2 base_class
 Typedef to this class. More...
 
typedef implements2 base_class
 Typedef to this class. More...
 
typedef extend_interfaces2< IAuditor, IPropertyextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces2< IAuditor, IPropertyextend_interfaces_base
 Typedef to the base of this class. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
typedef extend_interfaces_base::ext_iids interfaces
 MPL set of all the implemented interfaces. More...
 
- Public Types inherited from extend_interfaces2< IAuditor, IProperty >
typedef mpl::fold< typename IAuditor::iid::iids::type, typename IProperty::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef mpl::fold< typename IAuditor::iid::iids::type, typename IProperty::iid::iids::type, mpl::insert< mpl::_1, mpl::_2 > >::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Public Types inherited from IAuditor
enum  StandardEventType {
  Initialize, ReInitialize, Execute, BeginRun,
  EndRun, Finalize, Start, Stop,
  ReStart, Initialize, ReInitialize, Execute,
  BeginRun, EndRun, Finalize, Start,
  Stop, ReStart
}
 Defines the standard (= used by the framework) auditable event types. More...
 
enum  StandardEventType {
  Initialize, ReInitialize, Execute, BeginRun,
  EndRun, Finalize, Start, Stop,
  ReStart, Initialize, ReInitialize, Execute,
  BeginRun, EndRun, Finalize, Start,
  Stop, ReStart
}
 Defines the standard (= used by the framework) auditable event types. More...
 
typedef std::string CustomEventType
 Type used to allow users to specify a custom event to be audit. More...
 
typedef const CustomEventTypeCustomEventTypeRef
 Used in function calls for optimization purposes. More...
 
typedef std::string CustomEventType
 Type used to allow users to specify a custom event to be audit. More...
 
typedef const CustomEventTypeCustomEventTypeRef
 Used in function calls for optimization purposes. More...
 
- Public Types inherited from IInterface
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
enum  Status {
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR,
  SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR
}
 Return status. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
typedef Gaudi::InterfaceId< IInterface, 0, 0 > iid
 Interface ID. More...
 
typedef mpl::set1< iidext_iids
 Extra interfaces. More...
 
- Public Types inherited from extend_interfaces1< IIncidentListener >
typedef IIncidentListener::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
typedef IIncidentListener::iid::iids::type ext_iids
 MPL set of interfaces extended by this one. More...
 
- Static Public Member Functions inherited from IInterface
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 
static const InterfaceIDinterfaceID ()
 Return an instance of InterfaceID identifying the interface. More...
 

Detailed Description

Base for Google Auditors.

Author
Chris Jones
Date
18/04/2011

Definition at line 40 of file GoogleAuditor.cpp.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 312 of file GoogleAuditor.cpp.

314  : base_class ( name , pSvcLocator )
315  , m_log ( msgSvc() , name )
316  , m_audit ( true )
317  , m_nEvts ( 0 )
318  , m_sampleEventCount( 0 )
319  , m_inFullAudit ( false )
320  {
321  {
322  // Note: 'tmp' is needed to avoid an issue with list_of and C++11.
323  const std::vector<std::string> tmp =
324  boost::assign::list_of
325  ("Initialize")
326  ("ReInitialize")
327  ("Execute")
328  ("BeginRun")
329  ("EndRun")
330  ("Finalize");
331  m_when = tmp;
332  }
333 
334  declareProperty("ActivateAt", m_when,
335  "List of phases to activate the Auditoring during" );
336  declareProperty("DisableFor", m_veto,
337  "List of component names to disable the auditing for" );
338  declareProperty("EnableFor", m_list );
339  declareProperty("ProfileFreq", m_freq = -1,
340  "The frequence to audit events. -1 means all events" );
341  declareProperty("DoFullEventProfile", m_fullEventAudit = false,
342  "If true, instead of individually auditing components, the full event (or events) will be audited in one go" );
343  declareProperty("FullEventNSampleEvents", m_nSampleEvents = 1,
344  "The number of events to include in a full event audit, if enabled" );
345  declareProperty("SkipEvents", m_eventsToSkip = 0,
346  "Number of events to skip before activating the auditing" );
347  declareProperty("SkipSequencers", m_skipSequencers = true,
348  "If true, auditing will be skipped for Sequencer objects." );
349  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:224
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
extends1 base_class
Typedef to this class.
Definition: extends.h:12
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
int m_freq
The frequency to audit events. -1 means all events.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:237
unsigned long long m_nEvts
Number of events processed.
std::vector< std::string > m_list
Any component in this list will be audited. If empty, all will be done.
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
std::vector< std::string > m_when
When to audit the algorithms.
MsgStream m_log
Messaging object.
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
unsigned long long m_eventsToSkip
Number of events to skip before auditing.
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
virtual Google::AuditorBase::~AuditorBase ( )
inlinevirtual

Destructor.

Definition at line 49 of file GoogleAuditor.cpp.

49 { }

Member Function Documentation

void Google::AuditorBase::after ( StandardEventType  ,
INamedInterface ,
const StatusCode sc 
)
inlinevirtual

Audit the end of a standard "event".

Reimplemented from Auditor.

Definition at line 220 of file GoogleAuditor.cpp.

221  {
222  if ( !m_skipSequencers || !isSequencer(i) )
223  {
224  std::ostringstream t;
225  t << type;
226  after( t.str(), i, sc );
227  }
228  }
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
string type
Definition: gaudirun.py:151
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
void Google::AuditorBase::after ( CustomEventTypeRef  ,
INamedInterface ,
const StatusCode sc 
)
inlinevirtual

Audit the end of a custom "event".

Reimplemented from Auditor.

Definition at line 230 of file GoogleAuditor.cpp.

231  {
232  if ( !m_skipSequencers || !isSequencer(i) )
233  {
234  after( type, i->name(), sc );
235  }
236  }
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
string type
Definition: gaudirun.py:151
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
void Google::AuditorBase::after ( StandardEventType  ,
const std::string &  ,
const StatusCode sc 
)
inlinevirtual

Audit the end of a standard "event" for callers that do not implement INamedInterface.

Reimplemented from Auditor.

Definition at line 238 of file GoogleAuditor.cpp.

239  {
240  std::ostringstream t;
241  t << type;
242  after( t.str(), s, sc );
243  }
string s
Definition: gaudirun.py:244
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
string type
Definition: gaudirun.py:151
void Google::AuditorBase::after ( CustomEventTypeRef  ,
const std::string &  ,
const StatusCode sc 
)
inlinevirtual

Audit the end of a custom "event" for callers that do not implement INamedInterface.

Reimplemented from Auditor.

Definition at line 245 of file GoogleAuditor.cpp.

246  {
247  if ( !m_fullEventAudit && m_audit &&
249  {
250  if ( s == m_startedBy ) { google_after( getDumpName(type,s) ); }
251  }
252  }
std::string m_startedBy
Name of the component we are currently auditing.
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
bool isPhaseEnabled(const CustomEventTypeRef &type) const
Check if auditing is enabled for the current processing phase.
string s
Definition: gaudirun.py:244
virtual void google_after(const std::string &s)=0
stop the google tool
string type
Definition: gaudirun.py:151
bool isComponentEnabled(const std::string &name) const
Check if auditing is enabled for the given component.
std::string getDumpName(const CustomEventTypeRef &type, const std::string &name) const
void Google::AuditorBase::afterBeginRun ( INamedInterface )
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 265 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
void Google::AuditorBase::afterEndRun ( INamedInterface )
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 266 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
void Google::AuditorBase::afterExecute ( INamedInterface ,
const StatusCode  
)
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 264 of file GoogleAuditor.cpp.

264 { return after(IAuditor::Execute,i,s); }
string s
Definition: gaudirun.py:244
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
void Google::AuditorBase::afterFinalize ( INamedInterface )
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 267 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
void Google::AuditorBase::afterInitialize ( INamedInterface )
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 262 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
void Google::AuditorBase::afterReinitialize ( INamedInterface )
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 263 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
list i
Definition: ana.py:128
virtual bool Google::AuditorBase::alreadyRunning ( )
protectedpure virtual

check if we are already running the tool

Implemented in Google::CPUProfiler, Google::HeapChecker, and Google::HeapProfiler.

void Google::AuditorBase::before ( StandardEventType  evt,
INamedInterface obj 
)
inlinevirtual

The following methods are meant to be implemented by the child class...

Reimplemented from Auditor.

Definition at line 175 of file GoogleAuditor.cpp.

176  {
177  if ( !m_skipSequencers || !isSequencer(i) )
178  {
179  before( type, i->name() );
180  }
181  }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
string type
Definition: gaudirun.py:151
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
void Google::AuditorBase::before ( CustomEventTypeRef  ,
INamedInterface  
)
inlinevirtual

Audit the start of a custom "event".

Reimplemented from Auditor.

Definition at line 183 of file GoogleAuditor.cpp.

184  {
185  if ( !m_skipSequencers || !isSequencer(i) )
186  {
187  before( type, i->name() );
188  }
189  }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
string type
Definition: gaudirun.py:151
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
void Google::AuditorBase::before ( StandardEventType  ,
const std::string &   
)
inlinevirtual

Audit the start of a standard "event" for callers that do not implement INamedInterface.

Reimplemented from Auditor.

Definition at line 191 of file GoogleAuditor.cpp.

192  {
193  std::ostringstream t;
194  t << type;
195  before( t.str(), s );
196  }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
string s
Definition: gaudirun.py:244
string type
Definition: gaudirun.py:151
void Google::AuditorBase::before ( CustomEventTypeRef  ,
const std::string &   
)
inlinevirtual

Audit the start of a custom "event" for callers that do not implement INamedInterface.

Reimplemented from Auditor.

Definition at line 198 of file GoogleAuditor.cpp.

199  {
200  if ( !m_fullEventAudit && m_audit &&
202  {
203  if ( !alreadyRunning() )
204  {
205  m_log << MSG::INFO
206  << "Starting Auditor for " << s << ":" << type
207  << endmsg;
208  m_startedBy = s;
210  }
211  else
212  {
214  << "Auditor already running. Cannot be started for " << s
215  << endmsg;
216  }
217  }
218  }
std::string m_startedBy
Name of the component we are currently auditing.
virtual void google_before(const std::string &s)=0
Start the google tool.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
virtual bool alreadyRunning()=0
check if we are already running the tool
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
bool isPhaseEnabled(const CustomEventTypeRef &type) const
Check if auditing is enabled for the current processing phase.
string s
Definition: gaudirun.py:244
MsgStream m_log
Messaging object.
string type
Definition: gaudirun.py:151
bool isComponentEnabled(const std::string &name) const
Check if auditing is enabled for the given component.
std::string getDumpName(const CustomEventTypeRef &type, const std::string &name) const
void Google::AuditorBase::beforeBeginRun ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 258 of file GoogleAuditor.cpp.

258 { return before(IAuditor::BeginRun,i); }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
void Google::AuditorBase::beforeEndRun ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 259 of file GoogleAuditor.cpp.

259 { return before(IAuditor::EndRun,i); }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
void Google::AuditorBase::beforeExecute ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 257 of file GoogleAuditor.cpp.

257 { return before(IAuditor::Execute,i); }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
void Google::AuditorBase::beforeFinalize ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 260 of file GoogleAuditor.cpp.

260 { return before(IAuditor::Finalize,i); }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
void Google::AuditorBase::beforeInitialize ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 255 of file GoogleAuditor.cpp.

255 { return before(IAuditor::Initialize,i); }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
void Google::AuditorBase::beforeReinitialize ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 256 of file GoogleAuditor.cpp.

256 { return before(IAuditor::ReInitialize,i); }
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
list i
Definition: ana.py:128
StatusCode Google::AuditorBase::finalize ( )
inlinevirtual

Finalize the auditor base.

Reimplemented from Auditor.

Definition at line 70 of file GoogleAuditor.cpp.

71  {
72  if ( alreadyRunning() ) stopAudit();
73  return StatusCode::SUCCESS;
74  }
void stopAudit()
stop a full event audit
virtual bool alreadyRunning()=0
check if we are already running the tool
std::string Google::AuditorBase::getDumpName ( const CustomEventTypeRef type,
const std::string &  name 
) const
inlineprivate

Definition at line 124 of file GoogleAuditor.cpp.

126  {
127  std::ostringstream t;
128  t << name << "-" << type;
129  if ( type == "Execute" ) t << "-Event" << m_nEvts;
130  return t.str();
131  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
unsigned long long m_nEvts
Number of events processed.
string type
Definition: gaudirun.py:151
virtual void Google::AuditorBase::google_after ( const std::string &  s)
protectedpure virtual

stop the google tool

Implemented in Google::CPUProfiler, Google::HeapChecker, and Google::HeapProfiler.

virtual void Google::AuditorBase::google_before ( const std::string &  s)
protectedpure virtual

Start the google tool.

Implemented in Google::CPUProfiler, Google::HeapChecker, and Google::HeapProfiler.

void Google::AuditorBase::handle ( const Incident incident)
inlinevirtual

Implement the handle method for the Incident service.

This is used to inform the tool of software incidents.

Parameters
incidentThe incident identifier

Implements IIncidentListener.

Definition at line 140 of file GoogleAuditor.cpp.

141  {
142  if ( IncidentType::BeginEvent == incident.type() )
143  {
144  ++m_nEvts;
146  ( m_freq < 0 ||
147  m_nEvts == 1 ||
148  m_nEvts % m_freq == 0 ) );
149  m_log << MSG::DEBUG << "Event " << m_nEvts
150  << " Audit=" << m_audit << endmsg;
151  if ( m_fullEventAudit )
152  {
153  if ( m_inFullAudit )
154  {
156  alreadyRunning() )
157  {
158  stopAudit();
159  }
160  else
161  {
163  }
164  }
165  if ( m_audit && !m_inFullAudit && !alreadyRunning() )
166  {
167  startAudit();
168  }
169  }
170  }
171  }
const std::string BeginEvent
Processing of a new event has started.
Definition: Incident.h:60
void stopAudit()
stop a full event audit
const std::string & type() const
Access to the incident type.
Definition: Incident.h:34
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
void startAudit()
Start a full event audit.
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
virtual bool alreadyRunning()=0
check if we are already running the tool
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
int m_freq
The frequency to audit events. -1 means all events.
unsigned long long m_nEvts
Number of events processed.
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
MsgStream m_log
Messaging object.
unsigned long long m_eventsToSkip
Number of events to skip before auditing.
StatusCode Google::AuditorBase::initialize ( )
inlinevirtual

Initialize the auditor base.

Reimplemented from Auditor.

Reimplemented in Google::HeapChecker.

Definition at line 52 of file GoogleAuditor.cpp.

53  {
54  m_log << MSG::INFO << "Initialised" << endmsg;
55 
56  // add a listener for begin event
57  SmartIF<IIncidentSvc> inSvc(serviceLocator()->service("IncidentSvc"));
58  if ( ! inSvc.isValid() ) return StatusCode::FAILURE;
59  inSvc->addListener( this, IncidentType::BeginEvent );
60 
61  // sort various lists for speed when searching
62  std::sort( m_when.begin(), m_when.end() );
63  std::sort( m_veto.begin(), m_veto.end() );
64  std::sort( m_list.begin(), m_list.end() );
65 
66  return StatusCode::SUCCESS;
67  }
const std::string BeginEvent
Processing of a new event has started.
Definition: Incident.h:60
StatusCode service(const std::string &name, T *&svc, bool createIf=false) const
Access a service by name, creating it if it doesn't already exist.
Definition: Auditor.h:119
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
std::vector< std::string > m_list
Any component in this list will be audited. If empty, all will be done.
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:234
std::vector< std::string > m_when
When to audit the algorithms.
MsgStream m_log
Messaging object.
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
bool Google::AuditorBase::isComponentEnabled ( const std::string &  name) const
inlineprivate

Check if auditing is enabled for the given component.

Definition at line 116 of file GoogleAuditor.cpp.

117  {
118  return ( std::find(m_veto.begin(),m_veto.end(),name) == m_veto.end() &&
119  ( m_list.empty() ||
120  std::find(m_list.begin(),m_list.end(),name) != m_list.end() ) );
121  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:216
std::vector< std::string > m_list
Any component in this list will be audited. If empty, all will be done.
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
bool Google::AuditorBase::isPhaseEnabled ( const CustomEventTypeRef type) const
inlineprivate

Check if auditing is enabled for the current processing phase.

Definition at line 110 of file GoogleAuditor.cpp.

111  {
112  return ( std::find(m_when.begin(),m_when.end(),type) != m_when.end() );
113  }
std::vector< std::string > m_when
When to audit the algorithms.
string type
Definition: gaudirun.py:151
bool Google::AuditorBase::isSequencer ( INamedInterface i) const
inlineprivate

Check if the component in question is a GaudiSequencer or a Sequencer.

Definition at line 103 of file GoogleAuditor.cpp.

104  {
105  return ( dynamic_cast<GaudiSequencer*>(i) != NULL ||
106  dynamic_cast<Sequencer*>(i) != NULL );
107  }
void Google::AuditorBase::startAudit ( )
inlineprivate

Start a full event audit.

Definition at line 79 of file GoogleAuditor.cpp.

80  {
81  m_log << MSG::INFO << " -> Starting full audit from event " << m_nEvts << " to "
83  m_inFullAudit = true;
85  std::ostringstream t;
86  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
87  google_before(t.str());
88  }
virtual void google_before(const std::string &s)=0
Start the google tool.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
unsigned long long m_nEvts
Number of events processed.
MsgStream m_log
Messaging object.
void Google::AuditorBase::stopAudit ( )
inlineprivate

stop a full event audit

Definition at line 91 of file GoogleAuditor.cpp.

92  {
93  m_log << MSG::INFO << " -> Stopping full audit" << endmsg;
94  std::ostringstream t;
95  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
96  google_after(t.str());
97  m_inFullAudit = false;
99  }
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
unsigned long long m_nEvts
Number of events processed.
MsgStream m_log
Messaging object.
virtual void google_after(const std::string &s)=0
stop the google tool

Member Data Documentation

bool Google::AuditorBase::m_audit
private

Internal flag to say if auditing is enabled or not for the current event.

Definition at line 296 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_eventsToSkip
private

Number of events to skip before auditing.

Definition at line 290 of file GoogleAuditor.cpp.

int Google::AuditorBase::m_freq
private

The frequency to audit events. -1 means all events.

Definition at line 294 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_fullEventAudit
private

Flag to indicate if full event auditing is enabled or not.

Definition at line 300 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_inFullAudit
private

Internal flag to indicate if we are current in a full event audit.

Definition at line 306 of file GoogleAuditor.cpp.

std::vector<std::string> Google::AuditorBase::m_list
private

Any component in this list will be audited. If empty, all will be done.

Definition at line 288 of file GoogleAuditor.cpp.

MsgStream Google::AuditorBase::m_log
mutableprotected

Messaging object.

Definition at line 282 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_nEvts
private

Number of events processed.

Definition at line 298 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_nSampleEvents
private

Number of events to include in a full event audit.

Definition at line 302 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_sampleEventCount
private

Internal count of the number of events currently processed during an audit.

Definition at line 304 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_skipSequencers
private

Boolean indicating if sequencers should be skipped or not.

Definition at line 292 of file GoogleAuditor.cpp.

std::string Google::AuditorBase::m_startedBy
private

Name of the component we are currently auditing.

Definition at line 308 of file GoogleAuditor.cpp.

std::vector<std::string> Google::AuditorBase::m_veto
private

Veto list. Any component in this list will not be audited.

Definition at line 287 of file GoogleAuditor.cpp.

std::vector<std::string> Google::AuditorBase::m_when
private

When to audit the algorithms.

Definition at line 286 of file GoogleAuditor.cpp.


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