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, 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, 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...
 

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::Factory2
< 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 284 of file GoogleAuditor.cpp.

286  : base_class ( name , pSvcLocator )
287  , m_log ( msgSvc() , name )
288  , m_audit ( false )
289  , m_nEvts ( 0 )
290  , m_sampleEventCount( 0 )
291  , m_inFullAudit ( false )
292  {
293  {
294  // Note: 'tmp' is needed to avoid an issue with list_of and C++11.
295  const std::vector<std::string> tmp =
296  boost::assign::list_of
297  ("Initialize")
298  ("ReInitialize")
299  ("Execute")
300  ("BeginRun")
301  ("EndRun")
302  ("Finalize");
303  m_when = tmp;
304  }
305 
306  declareProperty("ActivateAt", m_when,
307  "List of phases to activate the Auditoring during" );
308  declareProperty("DisableFor", m_veto,
309  "List of component names to disable the auditing for" );
310  declareProperty("EnableFor", m_list );
311  declareProperty("ProfileFreq", m_freq = -1,
312  "The frequence to audit events. -1 means all events" );
313  declareProperty("DoFullEventProfile", m_fullEventAudit = false,
314  "If true, instead of individually auditing components, the full event (or events) will be audited in one go" );
315  declareProperty("FullEventNSampleEvents", m_nSampleEvents = 1,
316  "The number of events to include in a full event audit, if enabled" );
317  declareProperty("SkipEvents", m_eventsToSkip = 0,
318  "Number of events to skip before activating the auditing" );
319  declareProperty("SkipSequencers", m_skipSequencers = true,
320  "If true, auditing will be skipped for Sequencer objects." );
321  }
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:233
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 186 of file GoogleAuditor.cpp.

187  {
188  if ( !m_skipSequencers || !isSequencer(i) )
189  {
190  std::ostringstream t;
191  t << type;
192  after(t.str(),i,sc);
193  }
194  }
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 196 of file GoogleAuditor.cpp.

197  {
198  if ( !m_skipSequencers || !isSequencer(i) )
199  {
200  after(type,i->name(),sc);
201  }
202  }
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 204 of file GoogleAuditor.cpp.

205  {
206  std::ostringstream t;
207  t << type;
208  after(t.str(),s,sc);
209  }
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 211 of file GoogleAuditor.cpp.

212  {
213  if ( !m_fullEventAudit && m_audit &&
214  std::find(m_veto.begin(),m_veto.end(),s) == m_veto.end() &&
215  ( m_list.empty() || std::find(m_list.begin(),m_list.end(),s) != m_list.end() ) )
216  {
217  if ( s == m_startedBy )
218  {
219  std::ostringstream t;
220  t << s << "-Event" << m_nEvts;
221  google_after(t.str());
222  }
223  }
224  }
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.
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.
string s
Definition: gaudirun.py:210
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
virtual void google_after(const std::string &s)=0
stop the google tool
void Google::AuditorBase::afterBeginRun ( INamedInterface )
inlinevirtual
Deprecated:
use after

Reimplemented from Auditor.

Definition at line 237 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 238 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 236 of file GoogleAuditor.cpp.

236 { 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 239 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 234 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 235 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 140 of file GoogleAuditor.cpp.

141  {
142  if ( !m_skipSequencers || !isSequencer(i) )
143  {
144  before(type,i->name());
145  }
146  }
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 148 of file GoogleAuditor.cpp.

149  {
150  if ( !m_skipSequencers || !isSequencer(i) )
151  {
152  before(type,i->name());
153  }
154  }
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 156 of file GoogleAuditor.cpp.

157  {
158  std::ostringstream t;
159  t << type;
160  before(t.str(),s);
161  }
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 163 of file GoogleAuditor.cpp.

164  {
165  if ( !m_fullEventAudit && m_audit &&
166  std::find(m_veto.begin(),m_veto.end(),s) == m_veto.end() &&
167  ( m_list.empty() || std::find(m_list.begin(),m_list.end(),s) != m_list.end() ) )
168  {
169  if ( !alreadyRunning() )
170  {
171  m_log << MSG::INFO << "Starting Auditor for " << s << endmsg;
172  m_startedBy = s;
173  std::ostringstream t;
174  t << s << "-Event" << m_nEvts;
175  google_before(t.str());
176  }
177  else
178  {
180  << "Auditor already running. Cannot be started for " << s
181  << endmsg;
182  }
183  }
184  }
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
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.
string s
Definition: gaudirun.py:210
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:243
void Google::AuditorBase::beforeBeginRun ( INamedInterface )
inlinevirtual
Deprecated:
use before

Reimplemented from Auditor.

Definition at line 230 of file GoogleAuditor.cpp.

230 { 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 231 of file GoogleAuditor.cpp.

231 { 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 229 of file GoogleAuditor.cpp.

229 { 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 232 of file GoogleAuditor.cpp.

232 { 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 227 of file GoogleAuditor.cpp.

227 { 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 228 of file GoogleAuditor.cpp.

228 { 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 59 of file GoogleAuditor.cpp.

60  {
61  if ( alreadyRunning() ) stopAudit();
62  return StatusCode::SUCCESS;
63  }
void stopAudit()
stop a full event audit
virtual bool alreadyRunning()=0
check if we are already running the tool
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 105 of file GoogleAuditor.cpp.

106  {
107  if ( IncidentType::BeginEvent == incident.type() )
108  {
109  ++m_nEvts;
111  ( m_freq < 0 ||
112  m_nEvts == 1 ||
113  m_nEvts % m_freq == 0 ) );
114  m_log << MSG::DEBUG << "Event " << m_nEvts
115  << " Audit=" << m_audit << endmsg;
116  if ( m_fullEventAudit )
117  {
118  if ( m_inFullAudit )
119  {
121  alreadyRunning() )
122  {
123  stopAudit();
124  }
125  else
126  {
128  }
129  }
130  if ( m_audit && !m_inFullAudit && !alreadyRunning() )
131  {
132  startAudit();
133  }
134  }
135  }
136  }
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:243
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  SmartIF<IIncidentSvc> inSvc(serviceLocator()->service("IncidentSvc"));
51  if ( ! inSvc.isValid() ) return StatusCode::FAILURE;
52 
53  inSvc->addListener( this, IncidentType::BeginEvent );
54 
55  return StatusCode::SUCCESS;
56  }
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:117
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:236
MsgStream m_log
Messaging object.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:243
bool Google::AuditorBase::isSequencer ( INamedInterface i) const
inlineprivate

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

Definition at line 92 of file GoogleAuditor.cpp.

93  {
94  return ( dynamic_cast<GaudiSequencer*>(i) != NULL ||
95  dynamic_cast<Sequencer*>(i) != NULL );
96  }
void Google::AuditorBase::startAudit ( )
inlineprivate

Start a full event audit.

Definition at line 68 of file GoogleAuditor.cpp.

69  {
70  m_log << MSG::INFO << " -> Starting full audit from event " << m_nEvts << " to "
72  m_inFullAudit = true;
74  std::ostringstream t;
75  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
76  google_before(t.str());
77  }
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:243
void Google::AuditorBase::stopAudit ( )
inlineprivate

stop a full event audit

Definition at line 80 of file GoogleAuditor.cpp.

81  {
82  m_log << MSG::INFO << " -> Stopping full audit" << endmsg;
83  std::ostringstream t;
84  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
85  google_after(t.str());
86  m_inFullAudit = false;
88  }
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:243

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

unsigned long long Google::AuditorBase::m_eventsToSkip
private

Number of events to skip before auditing.

Definition at line 262 of file GoogleAuditor.cpp.

int Google::AuditorBase::m_freq
private

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

Definition at line 266 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_fullEventAudit
private

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

Definition at line 272 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 278 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 260 of file GoogleAuditor.cpp.

MsgStream Google::AuditorBase::m_log
mutableprotected

Messaging object.

Definition at line 254 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_nEvts
private

Number of events processed.

Definition at line 270 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 274 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 276 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_skipSequencers
private

Boolean indicating if sequencers should be skipped or not.

Definition at line 264 of file GoogleAuditor.cpp.

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

Name of the component we are currently auditing.

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

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

When to audit the algorithms.

Definition at line 258 of file GoogleAuditor.cpp.


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