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)
 
void before (CustomEventTypeRef type, INamedInterface *i)
 
void before (StandardEventType type, const std::string &s)
 
void before (CustomEventTypeRef type, const std::string &s)
 
void after (StandardEventType type, INamedInterface *i, const StatusCode &sc)
 
void after (CustomEventTypeRef type, INamedInterface *i, const StatusCode &sc)
 
void after (StandardEventType type, const std::string &s, const StatusCode &sc)
 
void after (CustomEventTypeRef type, const std::string &s, const StatusCode &)
 
void beforeInitialize (INamedInterface *i)
 
void beforeReinitialize (INamedInterface *i)
 
void beforeExecute (INamedInterface *i)
 
void beforeBeginRun (INamedInterface *i)
 
void beforeEndRun (INamedInterface *i)
 
void beforeFinalize (INamedInterface *i)
 
void afterInitialize (INamedInterface *i)
 
void afterReinitialize (INamedInterface *i)
 
void afterExecute (INamedInterface *i, const StatusCode &s)
 
void afterBeginRun (INamedInterface *i)
 
void afterEndRun (INamedInterface *i)
 
void afterFinalize (INamedInterface *i)
 
- Public Member Functions inherited from extends< Auditor, IIncidentListener >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from Auditor
 Auditor (const std::string &name, ISvcLocator *svcloc)
 Constructor. More...
 
 ~Auditor () override=default
 Destructor. More...
 
StatusCode sysInitialize () override
 Initialization method invoked by the framework. More...
 
StatusCode sysFinalize () override
 Finalization method invoked by the framework. More...
 
void before (StandardEventType, INamedInterface *) override
 The following methods are meant to be implemented by the child class... More...
 
void before (StandardEventType, const std::string &) override
 
void before (CustomEventTypeRef, INamedInterface *) override
 
void before (CustomEventTypeRef, const std::string &) override
 
void after (StandardEventType, INamedInterface *, const StatusCode &) override
 
void after (StandardEventType, const std::string &, const StatusCode &) override
 
void after (CustomEventTypeRef, INamedInterface *, const StatusCode &) override
 
void after (CustomEventTypeRef, const std::string &, const StatusCode &) override
 
void beforeInitialize (INamedInterface *) override
 
void afterInitialize (INamedInterface *) override
 
void beforeReinitialize (INamedInterface *) override
 
void afterReinitialize (INamedInterface *) override
 
void beforeExecute (INamedInterface *) override
 
void afterExecute (INamedInterface *, const StatusCode &) override
 
void beforeFinalize (INamedInterface *) override
 
void afterFinalize (INamedInterface *) override
 
void beforeBeginRun (INamedInterface *) override
 
void afterBeginRun (INamedInterface *) override
 
void beforeEndRun (INamedInterface *) override
 
void afterEndRun (INamedInterface *) override
 
const std::stringname () const override
 
bool isEnabled () const override
 
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...
 
template<class T = IService>
SmartIF< T > service (const std::string &name, bool createIf=false) const
 
StatusCode setProperty (const Property &p) override
 Set a value of a property of an auditor. More...
 
StatusCode setProperty (const std::string &s) override
 Implementation of IProperty::setProperty. More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 Implementation of IProperty::setProperty. More...
 
StatusCode getProperty (Property *p) const override
 Get the value of a property. More...
 
const PropertygetProperty (const std::string &name) const override
 Get the property by name. More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 Implementation of IProperty::getProperty. More...
 
const std::vector< Property * > & getProperties () const override
 Get all properties. More...
 
bool hasProperty (const std::string &name) const override
 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 CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
MSG::Level outputLevel () const __attribute__((deprecated))
 Backward compatibility function for getting the output level. More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. 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 Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. 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 (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 (CustomEventTypeRef type, const std::string &name) const
 

Private Attributes

std::vector< std::stringm_when
 When to audit the algorithms. More...
 
std::vector< std::stringm_veto
 Veto list. Any component in this list will not be audited. More...
 
std::vector< std::stringm_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 extends< Auditor, IIncidentListener >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from Auditor
typedef Gaudi::PluginService::Factory< IAuditor *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from CommonMessaging< implements< IAuditor, IProperty > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

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

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

50 { }

Member Function Documentation

void Google::AuditorBase::after ( StandardEventType  type,
INamedInterface i,
const StatusCode sc 
)
inline

Definition at line 221 of file GoogleAuditor.cpp.

222  {
223  if ( !m_skipSequencers || !isSequencer(i) )
224  {
226  t << type;
227  after( t.str(), i, sc );
228  }
229  }
string type
Definition: gaudirun.py:151
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
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  type,
INamedInterface i,
const StatusCode sc 
)
inline

Definition at line 231 of file GoogleAuditor.cpp.

232  {
233  if ( !m_skipSequencers || !isSequencer(i) )
234  {
235  after( type, i->name(), sc );
236  }
237  }
virtual const std::string & name() const =0
Retrieve the name of the instance.
string type
Definition: gaudirun.py:151
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
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  type,
const std::string s,
const StatusCode sc 
)
inline

Definition at line 239 of file GoogleAuditor.cpp.

240  {
242  t << type;
243  after( t.str(), s, sc );
244  }
string type
Definition: gaudirun.py:151
string s
Definition: gaudirun.py:245
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
void Google::AuditorBase::after ( CustomEventTypeRef  type,
const std::string s,
const StatusCode  
)
inline

Definition at line 246 of file GoogleAuditor.cpp.

247  {
248  if ( !m_fullEventAudit && m_audit &&
250  {
251  if ( s == m_startedBy ) { google_after( getDumpName(type,s) ); }
252  }
253  }
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:151
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
std::string getDumpName(CustomEventTypeRef type, const std::string &name) const
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
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.
void Google::AuditorBase::afterBeginRun ( INamedInterface i)
inline

Definition at line 266 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
void Google::AuditorBase::afterEndRun ( INamedInterface i)
inline

Definition at line 267 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
void Google::AuditorBase::afterExecute ( INamedInterface i,
const StatusCode s 
)
inline

Definition at line 265 of file GoogleAuditor.cpp.

265 { return after(IAuditor::Execute,i,s); }
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
void Google::AuditorBase::afterFinalize ( INamedInterface i)
inline

Definition at line 268 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
void Google::AuditorBase::afterInitialize ( INamedInterface i)
inline

Definition at line 263 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
void Google::AuditorBase::afterReinitialize ( INamedInterface i)
inline

Definition at line 264 of file GoogleAuditor.cpp.

void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
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  type,
INamedInterface i 
)
inline

Definition at line 176 of file GoogleAuditor.cpp.

177  {
178  if ( !m_skipSequencers || !isSequencer(i) )
179  {
180  before( type, i->name() );
181  }
182  }
virtual const std::string & name() const =0
Retrieve the name of the instance.
string type
Definition: gaudirun.py:151
void before(StandardEventType type, INamedInterface *i)
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  type,
INamedInterface i 
)
inline

Definition at line 184 of file GoogleAuditor.cpp.

185  {
186  if ( !m_skipSequencers || !isSequencer(i) )
187  {
188  before( type, i->name() );
189  }
190  }
virtual const std::string & name() const =0
Retrieve the name of the instance.
string type
Definition: gaudirun.py:151
void before(StandardEventType type, INamedInterface *i)
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  type,
const std::string s 
)
inline

Definition at line 192 of file GoogleAuditor.cpp.

193  {
195  t << type;
196  before( t.str(), s );
197  }
string type
Definition: gaudirun.py:151
void before(StandardEventType type, INamedInterface *i)
string s
Definition: gaudirun.py:245
void Google::AuditorBase::before ( CustomEventTypeRef  type,
const std::string s 
)
inline

Definition at line 199 of file GoogleAuditor.cpp.

200  {
201  if ( !m_fullEventAudit && m_audit &&
203  {
204  if ( !alreadyRunning() )
205  {
206  m_log << MSG::INFO
207  << "Starting Auditor for " << s << ":" << type
208  << endmsg;
209  m_startedBy = s;
211  }
212  else
213  {
215  << "Auditor already running. Cannot be started for " << s
216  << endmsg;
217  }
218  }
219  }
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:151
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
std::string getDumpName(CustomEventTypeRef type, const std::string &name) const
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
string s
Definition: gaudirun.py:245
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.
void Google::AuditorBase::beforeBeginRun ( INamedInterface i)
inline

Definition at line 259 of file GoogleAuditor.cpp.

259 { return before(IAuditor::BeginRun,i); }
void before(StandardEventType type, INamedInterface *i)
void Google::AuditorBase::beforeEndRun ( INamedInterface i)
inline

Definition at line 260 of file GoogleAuditor.cpp.

260 { return before(IAuditor::EndRun,i); }
void before(StandardEventType type, INamedInterface *i)
void Google::AuditorBase::beforeExecute ( INamedInterface i)
inline

Definition at line 258 of file GoogleAuditor.cpp.

258 { return before(IAuditor::Execute,i); }
void before(StandardEventType type, INamedInterface *i)
void Google::AuditorBase::beforeFinalize ( INamedInterface i)
inline

Definition at line 261 of file GoogleAuditor.cpp.

261 { return before(IAuditor::Finalize,i); }
void before(StandardEventType type, INamedInterface *i)
void Google::AuditorBase::beforeInitialize ( INamedInterface i)
inline

Definition at line 256 of file GoogleAuditor.cpp.

256 { return before(IAuditor::Initialize,i); }
void before(StandardEventType type, INamedInterface *i)
void Google::AuditorBase::beforeReinitialize ( INamedInterface i)
inline

Definition at line 257 of file GoogleAuditor.cpp.

257 { return before(IAuditor::ReInitialize,i); }
void before(StandardEventType type, INamedInterface *i)
StatusCode Google::AuditorBase::finalize ( )
inlinevirtual

Finalize the auditor base.

Reimplemented from Auditor.

Definition at line 71 of file GoogleAuditor.cpp.

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

Definition at line 125 of file GoogleAuditor.cpp.

127  {
129  t << name << "-" << type;
130  if ( type == "Execute" ) t << "-Event" << m_nEvts;
131  return t.str();
132  }
string type
Definition: gaudirun.py:151
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)
inline

Implement the handle method for the Incident service.

This is used to inform the tool of software incidents.

Parameters
incidentThe incident identifier

Definition at line 141 of file GoogleAuditor.cpp.

142  {
143  if ( IncidentType::BeginEvent == incident.type() )
144  {
145  ++m_nEvts;
147  ( m_freq < 0 ||
148  m_nEvts == 1 ||
149  m_nEvts % m_freq == 0 ) );
150  m_log << MSG::DEBUG << "Event " << m_nEvts
151  << " Audit=" << m_audit << endmsg;
152  if ( m_fullEventAudit )
153  {
154  if ( m_inFullAudit )
155  {
157  alreadyRunning() )
158  {
159  stopAudit();
160  }
161  else
162  {
164  }
165  }
166  if ( m_audit && !m_inFullAudit && !alreadyRunning() )
167  {
168  startAudit();
169  }
170  }
171  }
172  }
void stopAudit()
stop a full event audit
const std::string & type() const
Access to the incident type.
Definition: Incident.h:41
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 53 of file GoogleAuditor.cpp.

54  {
55  m_log << MSG::INFO << "Initialised" << endmsg;
56 
57  // add a listener for begin event
58  auto inSvc = serviceLocator()->service<IIncidentSvc>("IncidentSvc");
59  if ( !inSvc ) return StatusCode::FAILURE;
60  inSvc->addListener( this, IncidentType::BeginEvent );
61 
62  // sort various lists for speed when searching
66 
67  return StatusCode::SUCCESS;
68  }
T end(T...args)
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
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:211
std::vector< std::string > m_when
When to audit the algorithms.
T begin(T...args)
MsgStream m_log
Messaging object.
T sort(T...args)
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
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21
bool Google::AuditorBase::isComponentEnabled ( const std::string name) const
inlineprivate

Check if auditing is enabled for the given component.

Definition at line 117 of file GoogleAuditor.cpp.

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

Check if auditing is enabled for the current processing phase.

Definition at line 111 of file GoogleAuditor.cpp.

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

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

Definition at line 104 of file GoogleAuditor.cpp.

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

Start a full event audit.

Definition at line 80 of file GoogleAuditor.cpp.

81  {
82  m_log << MSG::INFO << " -> Starting full audit from event " << m_nEvts << " to "
84  m_inFullAudit = true;
87  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
88  google_before(t.str());
89  }
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 92 of file GoogleAuditor.cpp.

93  {
94  m_log << MSG::INFO << " -> Stopping full audit" << endmsg;
96  t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
97  google_after(t.str());
98  m_inFullAudit = false;
100  }
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 297 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_eventsToSkip
private

Number of events to skip before auditing.

Definition at line 291 of file GoogleAuditor.cpp.

int Google::AuditorBase::m_freq
private

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

Definition at line 295 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_fullEventAudit
private

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

Definition at line 301 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 307 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 289 of file GoogleAuditor.cpp.

MsgStream Google::AuditorBase::m_log
mutableprotected

Messaging object.

Definition at line 283 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_nEvts
private

Number of events processed.

Definition at line 299 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 303 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 305 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_skipSequencers
private

Boolean indicating if sequencers should be skipped or not.

Definition at line 293 of file GoogleAuditor.cpp.

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

Name of the component we are currently auditing.

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

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

When to audit the algorithms.

Definition at line 287 of file GoogleAuditor.cpp.


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