| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Google::AuditorBase Class Referenceabstract

Base for Google Auditors. More...

`#include <GoogleAuditor.cpp>`

Inheritance diagram for Google::AuditorBase:
[legend]
Collaboration diagram for Google::AuditorBase:
[legend]

## 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::string > | getInterfaceNames () 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::string & | name () 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 Property & | getProperty (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 >
Property * | declareProperty (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...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () 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::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 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 }
Google::AuditorBase::m_audit
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
Definition: GoogleAuditor.cpp:297
Google::AuditorBase::m_nSampleEvents
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
Definition: GoogleAuditor.cpp:303
extends< Auditor, IIncidentListener >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
Google::AuditorBase::m_inFullAudit
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
Definition: GoogleAuditor.cpp:307
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:305
Google::AuditorBase::m_freq
int m_freq
The frequency to audit events. -1 means all events.
Definition: GoogleAuditor.cpp:295
Auditor::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Auditor.h:232
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:299
Google::AuditorBase::m_list
std::vector< std::string > m_list
Any component in this list will be audited. If empty, all will be done.
Definition: GoogleAuditor.cpp:289
Google::AuditorBase::m_fullEventAudit
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
Definition: GoogleAuditor.cpp:301
Google::AuditorBase::m_when
std::vector< std::string > m_when
When to audit the algorithms.
Definition: GoogleAuditor.cpp:287
std::vector< std::string >
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
Google::AuditorBase::m_log
MsgStream m_log
Messaging object.
Definition: GoogleAuditor.cpp:283
Google::AuditorBase::m_veto
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
Definition: GoogleAuditor.cpp:288
Google::AuditorBase::m_eventsToSkip
unsigned long long m_eventsToSkip
Number of events to skip before auditing.
Definition: GoogleAuditor.cpp:291
Google::AuditorBase::m_skipSequencers
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
Definition: GoogleAuditor.cpp:293

virtual Google::AuditorBase::~AuditorBase | ( |  | ) |
| inline virtual

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 {
225 std::ostringstream t;
226 t << type;
227 after( t.str(), i, sc );
228 }
229 }
merge_files.sc
int sc
Definition: merge_files.py:167
gaudirun.type
string type
Definition: gaudirun.py:151
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221
ana.i
list i
Definition: ana.py:128
Google::AuditorBase::m_skipSequencers
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
Definition: GoogleAuditor.cpp:293
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:104

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 }
merge_files.sc
int sc
Definition: merge_files.py:167
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221
Google::AuditorBase::m_skipSequencers
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
Definition: GoogleAuditor.cpp:293
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:104

void Google::AuditorBase::after | ( | StandardEventType | type,
|  | const std::string & | s,
|  | const StatusCode & | sc
| ) |  |
| inline

Definition at line 239 of file GoogleAuditor.cpp.

240 {
241 std::ostringstream t;
242 t << type;
243 after( t.str(), s, sc );
244 }
merge_files.sc
int sc
Definition: merge_files.py:167
gaudirun.type
string type
Definition: gaudirun.py:151
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
gaudirun.s
string s
Definition: gaudirun.py:245
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

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 &&
249 isPhaseEnabled(type) && isComponentEnabled(s) )
250 {
251 if ( s == m_startedBy ) { google_after( getDumpName(type,s) ); }
252 }
253 }
Google::AuditorBase::m_startedBy
std::string m_startedBy
Name of the component we are currently auditing.
Definition: GoogleAuditor.cpp:309
Google::AuditorBase::m_audit
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
Definition: GoogleAuditor.cpp:297
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::isPhaseEnabled
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
Definition: GoogleAuditor.cpp:111
Google::AuditorBase::getDumpName
std::string getDumpName(CustomEventTypeRef type, const std::string &name) const
Definition: GoogleAuditor.cpp:125
Google::AuditorBase::m_fullEventAudit
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
Definition: GoogleAuditor.cpp:301
Google::AuditorBase::google_after
virtual void google_after(const std::string &s)=0
stop the google tool
Google::AuditorBase::isComponentEnabled
bool isComponentEnabled(const std::string &name) const
Check if auditing is enabled for the given component.
Definition: GoogleAuditor.cpp:117

void Google::AuditorBase::afterBeginRun | ( | INamedInterface * | i | ) |
| inline

Definition at line 266 of file GoogleAuditor.cpp.

266 { return after(IAuditor::BeginRun,i,StatusCode::SUCCESS); }
IAuditor::BeginRun
Definition: IAuditor.h:28
StatusCode::SUCCESS
Definition: StatusCode.h:30
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

void Google::AuditorBase::afterEndRun | ( | INamedInterface * | i | ) |
| inline

Definition at line 267 of file GoogleAuditor.cpp.

267 { return after(IAuditor::EndRun,i,StatusCode::SUCCESS); }
StatusCode::SUCCESS
Definition: StatusCode.h:30
IAuditor::EndRun
Definition: IAuditor.h:29
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

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); }
IAuditor::Execute
Definition: IAuditor.h:27
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

void Google::AuditorBase::afterFinalize | ( | INamedInterface * | i | ) |
| inline

Definition at line 268 of file GoogleAuditor.cpp.

268 { return after(IAuditor::Finalize,i,StatusCode::SUCCESS); }
StatusCode::SUCCESS
Definition: StatusCode.h:30
IAuditor::Finalize
Definition: IAuditor.h:30
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

void Google::AuditorBase::afterInitialize | ( | INamedInterface * | i | ) |
| inline

Definition at line 263 of file GoogleAuditor.cpp.

263 { return after(IAuditor::Initialize,i,StatusCode::SUCCESS); }
StatusCode::SUCCESS
Definition: StatusCode.h:30
IAuditor::Initialize
Definition: IAuditor.h:25
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

void Google::AuditorBase::afterReinitialize | ( | INamedInterface * | i | ) |
| inline

Definition at line 264 of file GoogleAuditor.cpp.

264 { return after(IAuditor::ReInitialize,i,StatusCode::SUCCESS); }
IAuditor::ReInitialize
Definition: IAuditor.h:26
StatusCode::SUCCESS
Definition: StatusCode.h:30
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
Definition: GoogleAuditor.cpp:221

virtual bool Google::AuditorBase::alreadyRunning | ( |  | ) |
| protected pure 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 }
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176
Google::AuditorBase::m_skipSequencers
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
Definition: GoogleAuditor.cpp:293
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:104

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 }
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176
Google::AuditorBase::m_skipSequencers
bool m_skipSequencers
Boolean indicating if sequencers should be skipped or not.
Definition: GoogleAuditor.cpp:293
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:104

void Google::AuditorBase::before | ( | StandardEventType | type,
|  | const std::string & | s
| ) |  |
| inline

Definition at line 192 of file GoogleAuditor.cpp.

193 {
194 std::ostringstream t;
195 t << type;
196 before( t.str(), s );
197 }
gaudirun.type
string type
Definition: gaudirun.py:151
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176
gaudirun.s
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 &&
202 isPhaseEnabled(type) && isComponentEnabled(s) )
203 {
204 if ( !alreadyRunning() )
205 {
206 m_log << MSG::INFO
207 << "Starting Auditor for " << s << ":" << type
208 << endmsg;
209 m_startedBy = s;
210 google_before( getDumpName(type,s) );
211 }
212 else
213 {
214 m_log << MSG::WARNING
215 << "Auditor already running. Cannot be started for " << s
216 << endmsg;
217 }
218 }
219 }
Google::AuditorBase::m_startedBy
std::string m_startedBy
Name of the component we are currently auditing.
Definition: GoogleAuditor.cpp:309
Google::AuditorBase::google_before
virtual void google_before(const std::string &s)=0
Start the google tool.
Google::AuditorBase::m_audit
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
Definition: GoogleAuditor.cpp:297
Google::AuditorBase::alreadyRunning
virtual bool alreadyRunning()=0
check if we are already running the tool
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::isPhaseEnabled
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
Definition: GoogleAuditor.cpp:111
Google::AuditorBase::getDumpName
std::string getDumpName(CustomEventTypeRef type, const std::string &name) const
Definition: GoogleAuditor.cpp:125
Google::AuditorBase::m_fullEventAudit
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
Definition: GoogleAuditor.cpp:301
gaudirun.s
string s
Definition: gaudirun.py:245
Google::AuditorBase::m_log
MsgStream m_log
Messaging object.
Definition: GoogleAuditor.cpp:283
MSG::WARNING
Definition: IMessageSvc.h:20
MSG::INFO
Definition: IMessageSvc.h:19
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
Google::AuditorBase::isComponentEnabled
bool isComponentEnabled(const std::string &name) const
Check if auditing is enabled for the given component.
Definition: GoogleAuditor.cpp:117

void Google::AuditorBase::beforeBeginRun | ( | INamedInterface * | i | ) |
| inline

Definition at line 259 of file GoogleAuditor.cpp.

259 { return before(IAuditor::BeginRun,i); }
IAuditor::BeginRun
Definition: IAuditor.h:28
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176

void Google::AuditorBase::beforeEndRun | ( | INamedInterface * | i | ) |
| inline

Definition at line 260 of file GoogleAuditor.cpp.

260 { return before(IAuditor::EndRun,i); }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176
IAuditor::EndRun
Definition: IAuditor.h:29

void Google::AuditorBase::beforeExecute | ( | INamedInterface * | i | ) |
| inline

Definition at line 258 of file GoogleAuditor.cpp.

258 { return before(IAuditor::Execute,i); }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176
IAuditor::Execute
Definition: IAuditor.h:27

void Google::AuditorBase::beforeFinalize | ( | INamedInterface * | i | ) |
| inline

Definition at line 261 of file GoogleAuditor.cpp.

261 { return before(IAuditor::Finalize,i); }
IAuditor::Finalize
Definition: IAuditor.h:30
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176

void Google::AuditorBase::beforeInitialize | ( | INamedInterface * | i | ) |
| inline

Definition at line 256 of file GoogleAuditor.cpp.

256 { return before(IAuditor::Initialize,i); }
IAuditor::Initialize
Definition: IAuditor.h:25
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176

void Google::AuditorBase::beforeReinitialize | ( | INamedInterface * | i | ) |
| inline

Definition at line 257 of file GoogleAuditor.cpp.

257 { return before(IAuditor::ReInitialize,i); }
IAuditor::ReInitialize
Definition: IAuditor.h:26
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i)
Definition: GoogleAuditor.cpp:176

StatusCode Google::AuditorBase::finalize | ( |  | ) |
| inline virtual

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 }
Google::AuditorBase::stopAudit
void stopAudit()
stop a full event audit
Definition: GoogleAuditor.cpp:92
Google::AuditorBase::alreadyRunning
virtual bool alreadyRunning()=0
check if we are already running the tool
StatusCode::SUCCESS
Definition: StatusCode.h:30

std::string Google::AuditorBase::getDumpName | ( | CustomEventTypeRef | type,
|  | const std::string & | name
| ) |  | const
| inline private

Definition at line 125 of file GoogleAuditor.cpp.

127 {
128 std::ostringstream t;
129 t << name << "-" << type;
130 if ( type == "Execute" ) t << "-Event" << m_nEvts;
131 return t.str();
132 }
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:299
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)

virtual void Google::AuditorBase::google_after | ( | const std::string & | s | ) |
| protected pure virtual

stop the google tool

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

virtual void Google::AuditorBase::google_before | ( | const std::string & | s | ) |
| protected pure 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

  incident | The incident identifier

Definition at line 141 of file GoogleAuditor.cpp.

142 {
143 if ( IncidentType::BeginEvent == incident.type() )
144 {
145 ++m_nEvts;
146 m_audit = ( m_nEvts > m_eventsToSkip &&
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 {
156 if ( m_sampleEventCount >= m_nSampleEvents &&
157 alreadyRunning() )
158 {
159 stopAudit();
160 }
161 else
162 {
163 ++m_sampleEventCount;
164 }
165 }
166 if ( m_audit && !m_inFullAudit && !alreadyRunning() )
167 {
168 startAudit();
169 }
170 }
171 }
172 }
Google::AuditorBase::stopAudit
void stopAudit()
stop a full event audit
Definition: GoogleAuditor.cpp:92
Incident::type
const std::string & type() const
Access to the incident type.
Definition: Incident.h:41
Google::AuditorBase::m_audit
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
Definition: GoogleAuditor.cpp:297
Google::AuditorBase::startAudit
void startAudit()
Start a full event audit.
Definition: GoogleAuditor.cpp:80
MSG::DEBUG
Definition: IMessageSvc.h:18
Google::AuditorBase::m_nSampleEvents
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
Definition: GoogleAuditor.cpp:303
Google::AuditorBase::alreadyRunning
virtual bool alreadyRunning()=0
check if we are already running the tool
Google::AuditorBase::m_inFullAudit
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
Definition: GoogleAuditor.cpp:307
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:305
Google::AuditorBase::m_freq
int m_freq
The frequency to audit events. -1 means all events.
Definition: GoogleAuditor.cpp:295
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:299
Google::AuditorBase::m_fullEventAudit
bool m_fullEventAudit
Flag to indicate if full event auditing is enabled or not.
Definition: GoogleAuditor.cpp:301
Google::AuditorBase::m_log
MsgStream m_log
Messaging object.
Definition: GoogleAuditor.cpp:283
Google::AuditorBase::m_eventsToSkip
unsigned long long m_eventsToSkip
Number of events to skip before auditing.
Definition: GoogleAuditor.cpp:291
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode Google::AuditorBase::initialize | ( |  | ) |
| inline virtual

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
63 std::sort( m_when.begin(), m_when.end() );
64 std::sort( m_veto.begin(), m_veto.end() );
65 std::sort( m_list.begin(), m_list.end() );
66
67 return StatusCode::SUCCESS;
68 }
std::vector::end
T end(T...args)
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
Google::AuditorBase::m_list
std::vector< std::string > m_list
Any component in this list will be audited. If empty, all will be done.
Definition: GoogleAuditor.cpp:289
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
Definition: Auditor.cpp:211
Google::AuditorBase::m_when
std::vector< std::string > m_when
When to audit the algorithms.
Definition: GoogleAuditor.cpp:287
std::vector::begin
T begin(T...args)
Google::AuditorBase::m_log
MsgStream m_log
Messaging object.
Definition: GoogleAuditor.cpp:283
std::sort
T sort(T...args)
Google::AuditorBase::m_veto
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
Definition: GoogleAuditor.cpp:288
MSG::INFO
Definition: IMessageSvc.h:19
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:21

bool Google::AuditorBase::isComponentEnabled | ( | const std::string & | name | ) | const
| inline private

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 }
std::vector::empty
T empty(T...args)
std::vector::end
T end(T...args)
Google::AuditorBase::m_list
std::vector< std::string > m_list
Any component in this list will be audited. If empty, all will be done.
Definition: GoogleAuditor.cpp:289
std::find
T find(T...args)
std::vector::begin
T begin(T...args)
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
Google::AuditorBase::m_veto
std::vector< std::string > m_veto
Veto list. Any component in this list will not be audited.
Definition: GoogleAuditor.cpp:288

bool Google::AuditorBase::isPhaseEnabled | ( | CustomEventTypeRef | type | ) | const
| inline private

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 }
std::vector::end
T end(T...args)
gaudirun.type
string type
Definition: gaudirun.py:151
Google::AuditorBase::m_when
std::vector< std::string > m_when
When to audit the algorithms.
Definition: GoogleAuditor.cpp:287
std::find
T find(T...args)
std::vector::begin
T begin(T...args)

bool Google::AuditorBase::isSequencer | ( | INamedInterface * | i | ) | const
| inline private

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 | ( |  | ) |
| inline private

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 "
83 << m_nEvts+m_nSampleEvents << endmsg;
84 m_inFullAudit = true;
85 m_sampleEventCount = 1;
86 std::ostringstream t;
87 t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
88 google_before(t.str());
89 }
Google::AuditorBase::google_before
virtual void google_before(const std::string &s)=0
Start the google tool.
Google::AuditorBase::m_nSampleEvents
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
Definition: GoogleAuditor.cpp:303
Google::AuditorBase::m_inFullAudit
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
Definition: GoogleAuditor.cpp:307
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:305
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:299
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
Google::AuditorBase::m_log
MsgStream m_log
Messaging object.
Definition: GoogleAuditor.cpp:283
MSG::INFO
Definition: IMessageSvc.h:19
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void Google::AuditorBase::stopAudit | ( |  | ) |
| inline private

stop a full event audit

Definition at line 92 of file GoogleAuditor.cpp.

93 {
94 m_log << MSG::INFO << " -> Stopping full audit" << endmsg;
95 std::ostringstream t;
96 t << "FULL-Events" << m_nEvts << "To" << m_nEvts+m_nSampleEvents ;
97 google_after(t.str());
98 m_inFullAudit = false;
99 m_sampleEventCount = 0;
100 }
Google::AuditorBase::m_nSampleEvents
unsigned long long m_nSampleEvents
Number of events to include in a full event audit.
Definition: GoogleAuditor.cpp:303
Google::AuditorBase::m_inFullAudit
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
Definition: GoogleAuditor.cpp:307
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:305
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:299
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
Google::AuditorBase::m_log
MsgStream m_log
Messaging object.
Definition: GoogleAuditor.cpp:283
MSG::INFO
Definition: IMessageSvc.h:19
Google::AuditorBase::google_after
virtual void google_after(const std::string &s)=0
stop the google tool
endmsg
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
| mutable protected

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:

- GaudiProfiling/src/component/google/GoogleAuditor.cpp