All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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...
 
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 std::vector< std::string > getInterfaceNames () const
 Implementation of IInterface::getInterfaceNames. 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...
 
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...
 
- Public Member Functions inherited from IAuditor
 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...
 
- 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...
 
- Public Member Functions inherited from IProperty
 DeclareInterfaceID (IProperty, 2, 0)
 InterfaceID. More...
 
- Public Member Functions inherited from extend_interfaces1< IIncidentListener >
virtual ~extend_interfaces1 ()
 Virtual destructor. More...
 
- Public Member Functions inherited from IIncidentListener
 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 extend_interfaces1
< IIncidentListener
extend_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...
 
- Public Types inherited from Auditor
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 extend_interfaces2
< IAuditor, IProperty
extend_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...
 
- 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...
 
- Public Types inherited from IAuditor
enum  StandardEventType {
  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...
 
- Public Types inherited from IInterface
enum  Status { 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...
 
- Public Types inherited from extend_interfaces1< IIncidentListener >
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...
 

Detailed Description

Base for Google Auditors.

Author
Chris Jones
Date
18/04/2011

Definition at line 34 of file GoogleAuditor.cpp.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 306 of file GoogleAuditor.cpp.

308  : base_class ( name , pSvcLocator )
309  , m_log ( msgSvc() , name )
310  , m_audit ( true )
311  , m_nEvts ( 0 )
312  , m_sampleEventCount( 0 )
313  , m_inFullAudit ( false )
314  {
315  {
316  // Note: 'tmp' is needed to avoid an issue with list_of and C++11.
317  const std::vector<std::string> tmp =
318  boost::assign::list_of
319  ("Initialize")
320  ("ReInitialize")
321  ("Execute")
322  ("BeginRun")
323  ("EndRun")
324  ("Finalize");
325  m_when = tmp;
326  }
327 
328  declareProperty("ActivateAt", m_when,
329  "List of phases to activate the Auditoring during" );
330  declareProperty("DisableFor", m_veto,
331  "List of component names to disable the auditing for" );
332  declareProperty("EnableFor", m_list );
333  declareProperty("ProfileFreq", m_freq = -1,
334  "The frequence to audit events. -1 means all events" );
335  declareProperty("DoFullEventProfile", m_fullEventAudit = false,
336  "If true, instead of individually auditing components, the full event (or events) will be audited in one go" );
337  declareProperty("FullEventNSampleEvents", m_nSampleEvents = 1,
338  "The number of events to include in a full event audit, if enabled" );
339  declareProperty("SkipEvents", m_eventsToSkip = 0,
340  "Number of events to skip before activating the auditing" );
341  declareProperty("SkipSequencers", m_skipSequencers = true,
342  "If true, auditing will be skipped for Sequencer objects." );
343  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: Auditor.cpp:226
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:235
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 43 of file GoogleAuditor.cpp.

43 { }

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 214 of file GoogleAuditor.cpp.

215  {
216  if ( !m_skipSequencers || !isSequencer(i) )
217  {
218  std::ostringstream t;
219  t << type;
220  after( t.str(), i, sc );
221  }
222  }
string type
Definition: gaudirun.py:126
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.
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 224 of file GoogleAuditor.cpp.

225  {
226  if ( !m_skipSequencers || !isSequencer(i) )
227  {
228  after( type, i->name(), sc );
229  }
230  }
string type
Definition: gaudirun.py:126
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.
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 232 of file GoogleAuditor.cpp.

233  {
234  std::ostringstream t;
235  t << type;
236  after( t.str(), s, sc );
237  }
string type
Definition: gaudirun.py:126
string s
Definition: gaudirun.py:210
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Audit the end of a standard "event".
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 239 of file GoogleAuditor.cpp.

240  {
241  if ( !m_fullEventAudit && m_audit &&
243  {
244  if ( s == m_startedBy ) { google_after( getDumpName(type,s) ); }
245  }
246  }
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.
string type
Definition: gaudirun.py:126
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:210
virtual void google_after(const std::string &s)=0
stop the google tool
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 259 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 260 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 258 of file GoogleAuditor.cpp.

258 { return after(IAuditor::Execute,i,s); }
string s
Definition: gaudirun.py:210
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 261 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 256 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 257 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 169 of file GoogleAuditor.cpp.

170  {
171  if ( !m_skipSequencers || !isSequencer(i) )
172  {
173  before( type, i->name() );
174  }
175  }
string type
Definition: gaudirun.py:126
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.
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 177 of file GoogleAuditor.cpp.

178  {
179  if ( !m_skipSequencers || !isSequencer(i) )
180  {
181  before( type, i->name() );
182  }
183  }
string type
Definition: gaudirun.py:126
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.
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 185 of file GoogleAuditor.cpp.

186  {
187  std::ostringstream t;
188  t << type;
189  before( t.str(), s );
190  }
string type
Definition: gaudirun.py:126
void before(StandardEventType type, INamedInterface *i)
The following methods are meant to be implemented by the child class...
string s
Definition: gaudirun.py:210
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 192 of file GoogleAuditor.cpp.

193  {
194  if ( !m_fullEventAudit && m_audit &&
196  {
197  if ( !alreadyRunning() )
198  {
199  m_log << MSG::INFO
200  << "Starting Auditor for " << s << ":" << type
201  << endmsg;
202  m_startedBy = s;
204  }
205  else
206  {
208  << "Auditor already running. Cannot be started for " << s
209  << endmsg;
210  }
211  }
212  }
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.
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
string type
Definition: gaudirun.py:126
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:210
MsgStream m_log
Messaging object.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
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 252 of file GoogleAuditor.cpp.

252 { 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 253 of file GoogleAuditor.cpp.

253 { 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 251 of file GoogleAuditor.cpp.

251 { 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 254 of file GoogleAuditor.cpp.

254 { 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 249 of file GoogleAuditor.cpp.

249 { 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 250 of file GoogleAuditor.cpp.

250 { 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 64 of file GoogleAuditor.cpp.

65  {
66  if ( alreadyRunning() ) stopAudit();
67  return StatusCode::SUCCESS;
68  }
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 118 of file GoogleAuditor.cpp.

120  {
121  std::ostringstream t;
122  t << name << "-" << type;
123  if ( type == "Execute" ) t << "-Event" << m_nEvts;
124  return t.str();
125  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
string type
Definition: gaudirun.py:126
unsigned long long m_nEvts
Number of events processed.
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 134 of file GoogleAuditor.cpp.

135  {
136  if ( IncidentType::BeginEvent == incident.type() )
137  {
138  ++m_nEvts;
140  ( m_freq < 0 ||
141  m_nEvts == 1 ||
142  m_nEvts % m_freq == 0 ) );
143  m_log << MSG::DEBUG << "Event " << m_nEvts
144  << " Audit=" << m_audit << endmsg;
145  if ( m_fullEventAudit )
146  {
147  if ( m_inFullAudit )
148  {
150  alreadyRunning() )
151  {
152  stopAudit();
153  }
154  else
155  {
157  }
158  }
159  if ( m_audit && !m_inFullAudit && !alreadyRunning() )
160  {
161  startAudit();
162  }
163  }
164  }
165  }
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
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.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode Google::AuditorBase::initialize ( )
inlinevirtual

Initialize the auditor base.

Reimplemented from Auditor.

Reimplemented in Google::HeapChecker.

Definition at line 46 of file GoogleAuditor.cpp.

47  {
48  m_log << MSG::INFO << "Initialised" << endmsg;
49 
50  // add a listener for begin event
51  SmartIF<IIncidentSvc> inSvc(serviceLocator()->service("IncidentSvc"));
52  if ( ! inSvc.isValid() ) return StatusCode::FAILURE;
53  inSvc->addListener( this, IncidentType::BeginEvent );
54 
55  // sort various lists for speed when searching
56  std::sort( m_when.begin(), m_when.end() );
57  std::sort( m_veto.begin(), m_veto.end() );
58  std::sort( m_list.begin(), m_list.end() );
59 
60  return StatusCode::SUCCESS;
61  }
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
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:236
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.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
bool Google::AuditorBase::isComponentEnabled ( const std::string &  name) const
inlineprivate

Check if auditing is enabled for the given component.

Definition at line 110 of file GoogleAuditor.cpp.

111  {
112  return ( std::find(m_veto.begin(),m_veto.end(),name) == m_veto.end() &&
113  ( m_list.empty() ||
114  std::find(m_list.begin(),m_list.end(),name) != m_list.end() ) );
115  }
virtual const std::string & name() const
Retrieve the name of the instance.
Definition: Auditor.cpp:218
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 104 of file GoogleAuditor.cpp.

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

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

Definition at line 97 of file GoogleAuditor.cpp.

98  {
99  return ( dynamic_cast<GaudiSequencer*>(i) != NULL ||
100  dynamic_cast<Sequencer*>(i) != NULL );
101  }
void Google::AuditorBase::startAudit ( )
inlineprivate

Start a full event audit.

Definition at line 73 of file GoogleAuditor.cpp.

74  {
75  m_log << MSG::INFO << " -> Starting full audit from event " << m_nEvts << " to "
77  m_inFullAudit = true;
79  std::ostringstream t;
80  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
81  google_before(t.str());
82  }
virtual void google_before(const std::string &s)=0
Start the google tool.
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.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
void Google::AuditorBase::stopAudit ( )
inlineprivate

stop a full event audit

Definition at line 85 of file GoogleAuditor.cpp.

86  {
87  m_log << MSG::INFO << " -> Stopping full audit" << endmsg;
88  std::ostringstream t;
89  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
90  google_after(t.str());
91  m_inFullAudit = false;
93  }
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
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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 290 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_eventsToSkip
private

Number of events to skip before auditing.

Definition at line 284 of file GoogleAuditor.cpp.

int Google::AuditorBase::m_freq
private

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

Definition at line 288 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_fullEventAudit
private

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

Definition at line 294 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 300 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 282 of file GoogleAuditor.cpp.

MsgStream Google::AuditorBase::m_log
mutableprotected

Messaging object.

Definition at line 276 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_nEvts
private

Number of events processed.

Definition at line 292 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 296 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 298 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_skipSequencers
private

Boolean indicating if sequencers should be skipped or not.

Definition at line 286 of file GoogleAuditor.cpp.

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

Name of the component we are currently auditing.

Definition at line 302 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 281 of file GoogleAuditor.cpp.

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

When to audit the algorithms.

Definition at line 280 of file GoogleAuditor.cpp.


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