| The Gaudi Framework v30r0 (c919700c)

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

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

Public Member Functions | Protected Member Functions | 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 () override=default
| Destructor. More...
StatusCode | initialize () override
| Initialize the auditor base. More...
StatusCode | finalize () override
| Finalize the auditor base. More...
void | handle (const Incident &incident) override
| Implement the handle method for the Incident service. More...
void | before (StandardEventType type, INamedInterface *i) override
void | before (CustomEventTypeRef type, INamedInterface *i) override
void | before (StandardEventType type, const std::string &s) override
void | before (CustomEventTypeRef type, const std::string &s) override
void | after (StandardEventType type, INamedInterface *i, const StatusCode &sc) override
void | after (CustomEventTypeRef type, INamedInterface *i, const StatusCode &sc) override
void | after (StandardEventType type, const std::string &s, const StatusCode &sc) override
void | after (CustomEventTypeRef type, const std::string &s, const StatusCode &) override
void | beforeInitialize (INamedInterface *i) override
void | beforeReinitialize (INamedInterface *i) override
void | beforeExecute (INamedInterface *i) override
void | beforeBeginRun (INamedInterface *i) override
void | beforeEndRun (INamedInterface *i) override
void | beforeFinalize (INamedInterface *i) override
void | afterInitialize (INamedInterface *i) override
void | afterReinitialize (INamedInterface *i) override
void | afterExecute (INamedInterface *i, const StatusCode &s) override
void | afterBeginRun (INamedInterface *i) override
void | afterEndRun (INamedInterface *i) override
void | afterFinalize (INamedInterface *i) override
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 (const Auditor &a)=delete
Auditor & | operator= (const Auditor &rhs)=delete
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 override
| 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 | setProperties ()
| Set the auditor's properties. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
| PropertyHolder ()=default
| ~PropertyHolder () override=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none") const
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const 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 cached level (originally extracted 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 PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAuditor, IProperty > >
MSG::Level | setUpMessaging ()
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. 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
Gaudi::Property< std::vector< std::string > > | m_when
Gaudi::Property< std::vector< std::string > > | m_veto
Gaudi::Property< std::vector< std::string > > | m_list
Gaudi::Property< int > | m_freq {this, "ProfileFreq", -1, "The frequence to audit events. -1 means all events"}
Gaudi::Property< bool > | m_fullEventAudit
Gaudi::Property< unsigned long long > | m_nSampleEvents
Gaudi::Property< unsigned long long > | m_eventsToSkip
Gaudi::Property< bool > | m_skipSequencers
bool | m_audit = true
| Internal flag to say if auditing is enabled or not for the current event. More...
unsigned long long | m_nEvts = 0
| Number of events processed. More...
unsigned long long | m_sampleEventCount
| Internal count of the number of events currently processed during an audit. More...
bool | m_inFullAudit = false
| 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 PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAuditor, IProperty > > >
| Typedef used to refer to this class from derived classes, as in. More...
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 | ( |  | ) |
| override default

Destructor.

## Member Function Documentation

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

Definition at line 189 of file GoogleAuditor.cpp.

190 {
191 if ( !m_skipSequencers || !isSequencer( i ) ) {
192 std::ostringstream t;
193 t << type;
194 after( t.str(), i, sc );
195 }
196 }
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:133
std::ostringstream::str
T str(T...args)
Google::AuditorBase::m_skipSequencers
Gaudi::Property< bool > m_skipSequencers
Definition: GoogleAuditor.cpp:270
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:100

void Google::AuditorBase::after | ( | CustomEventTypeRef | type,
|  | INamedInterface * | i,
|  | const StatusCode & | sc
| ) |  |
| inline override

Definition at line 198 of file GoogleAuditor.cpp.

199 {
200 if ( !m_skipSequencers || !isSequencer( i ) ) {
201 after( type, i->name(), sc );
202 }
203 }
gaudirun.type
type
Definition: gaudirun.py:133
Google::AuditorBase::m_skipSequencers
Gaudi::Property< bool > m_skipSequencers
Definition: GoogleAuditor.cpp:270
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:100

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

Definition at line 205 of file GoogleAuditor.cpp.

206 {
207 std::ostringstream t;
208 t << type;
209 after( t.str(), s, sc );
210 }
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:133
std::ostringstream::str
T str(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189

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

Definition at line 212 of file GoogleAuditor.cpp.

213 {
214 if ( !m_fullEventAudit && m_audit && isPhaseEnabled( type ) && isComponentEnabled( s ) ) {
215 if ( s == m_startedBy ) {
216 google_after( getDumpName( type, s ) );
217 }
218 }
219 }
Google::AuditorBase::m_startedBy
std::string m_startedBy
Name of the component we are currently auditing.
Definition: GoogleAuditor.cpp:278
Google::AuditorBase::m_audit
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
Definition: GoogleAuditor.cpp:273
Google::AuditorBase::m_fullEventAudit
Gaudi::Property< bool > m_fullEventAudit
Definition: GoogleAuditor.cpp:263
Google::AuditorBase::isPhaseEnabled
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
Definition: GoogleAuditor.cpp:106
gaudirun.type
type
Definition: gaudirun.py:133
Google::AuditorBase::getDumpName
std::string getDumpName(CustomEventTypeRef type, const std::string &name) const
Definition: GoogleAuditor.cpp:119
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:112

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

Definition at line 238 of file GoogleAuditor.cpp.

238 { return after( IAuditor::BeginRun, i, StatusCode::SUCCESS ); }
IAuditor::BeginRun
Definition: IAuditor.h:25
StatusCode::SUCCESS
Definition: StatusCode.h:29
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189

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

Definition at line 239 of file GoogleAuditor.cpp.

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

void Google::AuditorBase::afterExecute | ( | INamedInterface * | i,
|  | const StatusCode & | s
| ) |  |
| inline override

Definition at line 237 of file GoogleAuditor.cpp.

237 { return after( IAuditor::Execute, i, s ); }
IAuditor::Execute
Definition: IAuditor.h:25
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189

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

Definition at line 240 of file GoogleAuditor.cpp.

240 { return after( IAuditor::Finalize, i, StatusCode::SUCCESS ); }
StatusCode::SUCCESS
Definition: StatusCode.h:29
IAuditor::Finalize
Definition: IAuditor.h:25
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189

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

Definition at line 229 of file GoogleAuditor.cpp.

230 {
231 return after( IAuditor::Initialize, i, StatusCode::SUCCESS );
232 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
IAuditor::Initialize
Definition: IAuditor.h:25
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189

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

Definition at line 233 of file GoogleAuditor.cpp.

234 {
235 return after( IAuditor::ReInitialize, i, StatusCode::SUCCESS );
236 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
IAuditor::ReInitialize
Definition: IAuditor.h:25
Google::AuditorBase::after
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Definition: GoogleAuditor.cpp:189

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 override

Definition at line 155 of file GoogleAuditor.cpp.

156 {
157 if ( !m_skipSequencers || !isSequencer( i ) ) {
158 before( type, i->name() );
159 }
160 }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155
gaudirun.type
type
Definition: gaudirun.py:133
Google::AuditorBase::m_skipSequencers
Gaudi::Property< bool > m_skipSequencers
Definition: GoogleAuditor.cpp:270
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:100

void Google::AuditorBase::before | ( | CustomEventTypeRef | type,
|  | INamedInterface * | i
| ) |  |
| inline override

Definition at line 162 of file GoogleAuditor.cpp.

163 {
164 if ( !m_skipSequencers || !isSequencer( i ) ) {
165 before( type, i->name() );
166 }
167 }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155
gaudirun.type
type
Definition: gaudirun.py:133
Google::AuditorBase::m_skipSequencers
Gaudi::Property< bool > m_skipSequencers
Definition: GoogleAuditor.cpp:270
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
Google::AuditorBase::isSequencer
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
Definition: GoogleAuditor.cpp:100

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

Definition at line 169 of file GoogleAuditor.cpp.

170 {
171 std::ostringstream t;
172 t << type;
173 before( t.str(), s );
174 }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:133
std::ostringstream::str
T str(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253

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

Definition at line 176 of file GoogleAuditor.cpp.

177 {
178 if ( !m_fullEventAudit && m_audit && isPhaseEnabled( type ) && isComponentEnabled( s ) ) {
179 if ( !alreadyRunning() ) {
180 info() << "Starting Auditor for " << s << ":" << type << endmsg;
181 m_startedBy = s;
182 google_before( getDumpName( type, s ) );
183 } else {
184 warning() << "Auditor already running. Cannot be started for " << s << endmsg;
185 }
186 }
187 }
Google::AuditorBase::m_startedBy
std::string m_startedBy
Name of the component we are currently auditing.
Definition: GoogleAuditor.cpp:278
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
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:273
Google::AuditorBase::m_fullEventAudit
Gaudi::Property< bool > m_fullEventAudit
Definition: GoogleAuditor.cpp:263
Google::AuditorBase::alreadyRunning
virtual bool alreadyRunning()=0
check if we are already running the tool
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:109
Google::AuditorBase::isPhaseEnabled
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
Definition: GoogleAuditor.cpp:106
gaudirun.type
type
Definition: gaudirun.py:133
Google::AuditorBase::getDumpName
std::string getDumpName(CustomEventTypeRef type, const std::string &name) const
Definition: GoogleAuditor.cpp:119
gaudirun.s
string s
Definition: gaudirun.py:253
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
Google::AuditorBase::isComponentEnabled
bool isComponentEnabled(const std::string &name) const
Check if auditing is enabled for the given component.
Definition: GoogleAuditor.cpp:112

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

Definition at line 225 of file GoogleAuditor.cpp.

225 { return before( IAuditor::BeginRun, i ); }
IAuditor::BeginRun
Definition: IAuditor.h:25
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155

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

Definition at line 226 of file GoogleAuditor.cpp.

226 { return before( IAuditor::EndRun, i ); }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155
IAuditor::EndRun
Definition: IAuditor.h:25

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

Definition at line 224 of file GoogleAuditor.cpp.

224 { return before( IAuditor::Execute, i ); }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155
IAuditor::Execute
Definition: IAuditor.h:25

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

Definition at line 227 of file GoogleAuditor.cpp.

227 { return before( IAuditor::Finalize, i ); }
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155
IAuditor::Finalize
Definition: IAuditor.h:25

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

Definition at line 222 of file GoogleAuditor.cpp.

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

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

Definition at line 223 of file GoogleAuditor.cpp.

223 { return before( IAuditor::ReInitialize, i ); }
IAuditor::ReInitialize
Definition: IAuditor.h:25
Google::AuditorBase::before
void before(StandardEventType type, INamedInterface *i) override
Definition: GoogleAuditor.cpp:155

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

Finalize the auditor base.

Reimplemented from Auditor.

Definition at line 69 of file GoogleAuditor.cpp.

70 {
71 if ( alreadyRunning() ) stopAudit();
72 return StatusCode::SUCCESS;
73 }
StatusCode::SUCCESS
Definition: StatusCode.h:29
Google::AuditorBase::stopAudit
void stopAudit()
stop a full event audit
Definition: GoogleAuditor.cpp:88
Google::AuditorBase::alreadyRunning
virtual bool alreadyRunning()=0
check if we are already running the tool

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

Definition at line 119 of file GoogleAuditor.cpp.

120 {
121 std::ostringstream t;
122 t << name << "-" << type;
123 if ( type == "Execute" ) t << "-Event" << m_nEvts;
124 return t.str();
125 }
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:274
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:133
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 override

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

134 {
135 if ( IncidentType::BeginEvent == incident.type() ) {
136 ++m_nEvts;
137 m_audit = ( m_nEvts > m_eventsToSkip && ( m_freq < 0 || m_nEvts == 1 || m_nEvts % m_freq == 0 ) );
138 if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "Event " << m_nEvts << " Audit=" << m_audit << endmsg;
139 if ( m_fullEventAudit ) {
140 if ( m_inFullAudit ) {
141 if ( m_sampleEventCount >= m_nSampleEvents && alreadyRunning() ) {
142 stopAudit();
143 } else {
144 ++m_sampleEventCount;
145 }
146 }
147 if ( m_audit && !m_inFullAudit && !alreadyRunning() ) {
148 startAudit();
149 }
150 }
151 }
152 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
Google::AuditorBase::stopAudit
void stopAudit()
stop a full event audit
Definition: GoogleAuditor.cpp:88
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:273
Google::AuditorBase::startAudit
void startAudit()
Start a full event audit.
Definition: GoogleAuditor.cpp:77
MSG::DEBUG
Definition: IMessageSvc.h:16
Google::AuditorBase::m_freq
Gaudi::Property< int > m_freq
Definition: GoogleAuditor.cpp:262
Google::AuditorBase::m_fullEventAudit
Gaudi::Property< bool > m_fullEventAudit
Definition: GoogleAuditor.cpp:263
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:277
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:275
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:274
Google::AuditorBase::m_nSampleEvents
Gaudi::Property< unsigned long long > m_nSampleEvents
Definition: GoogleAuditor.cpp:266
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:115
Google::AuditorBase::m_eventsToSkip
Gaudi::Property< unsigned long long > m_eventsToSkip
Definition: GoogleAuditor.cpp:268
CommonMessagingBase::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:124
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

Initialize the auditor base.

Reimplemented from Auditor.

Reimplemented in Google::HeapChecker.

Definition at line 51 of file GoogleAuditor.cpp.

52 {
53 info() << "Initialised" << endmsg;
54
55 // add a listener for begin event
56 auto inSvc = serviceLocator()->service<IIncidentSvc>( "IncidentSvc" );
57 if ( !inSvc ) return StatusCode::FAILURE;
58 inSvc->addListener( this, IncidentType::BeginEvent );
59
60 // sort various lists for speed when searching
61 std::sort( m_when.begin(), m_when.end() );
62 std::sort( m_veto.begin(), m_veto.end() );
63 std::sort( m_list.begin(), m_list.end() );
64
65 return StatusCode::SUCCESS;
66 }
Google::AuditorBase::m_list
Gaudi::Property< std::vector< std::string > > m_list
Definition: GoogleAuditor.cpp:260
StatusCode::SUCCESS
Definition: StatusCode.h:29
Google::AuditorBase::m_when
Gaudi::Property< std::vector< std::string > > m_when
Definition: GoogleAuditor.cpp:253
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
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:79
Auditor::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Auditor.cpp:206
std::sort
T sort(T...args)
StatusCode::FAILURE
Definition: StatusCode.h:29
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
Google::AuditorBase::m_veto
Gaudi::Property< std::vector< std::string > > m_veto
Definition: GoogleAuditor.cpp:258

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

Check if auditing is enabled for the given component.

Definition at line 112 of file GoogleAuditor.cpp.

113 {
114 return ( std::find( m_veto.begin(), m_veto.end(), name ) == m_veto.end() &&
115 ( m_list.empty() || std::find( m_list.begin(), m_list.end(), name ) != m_list.end() ) );
116 }
Google::AuditorBase::m_list
Gaudi::Property< std::vector< std::string > > m_list
Definition: GoogleAuditor.cpp:260
std::find
T find(T...args)
Auditor::name
const std::string & name() const override
Definition: Auditor.cpp:202
Google::AuditorBase::m_veto
Gaudi::Property< std::vector< std::string > > m_veto
Definition: GoogleAuditor.cpp:258

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

Check if auditing is enabled for the current processing phase.

Definition at line 106 of file GoogleAuditor.cpp.

107 {
108 return ( std::find( m_when.begin(), m_when.end(), type ) != m_when.end() );
109 }
Google::AuditorBase::m_when
Gaudi::Property< std::vector< std::string > > m_when
Definition: GoogleAuditor.cpp:253
gaudirun.type
type
Definition: gaudirun.py:133
std::find
T find(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 100 of file GoogleAuditor.cpp.

101 {
102 return ( dynamic_cast<GaudiSequencer*>( i ) != NULL || dynamic_cast<Sequencer*>( i ) != NULL );
103 }

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

Start a full event audit.

Definition at line 77 of file GoogleAuditor.cpp.

78 {
79 info() << " -> Starting full audit from event " << m_nEvts << " to " << m_nEvts + m_nSampleEvents << endmsg;
80 m_inFullAudit = true;
81 m_sampleEventCount = 1;
82 std::ostringstream t;
83 t << "FULL-Events" << m_nEvts << "To" << m_nEvts + m_nSampleEvents;
84 google_before( t.str() );
85 }
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
Google::AuditorBase::google_before
virtual void google_before(const std::string &s)=0
Start the google tool.
Google::AuditorBase::m_inFullAudit
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
Definition: GoogleAuditor.cpp:277
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:275
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:274
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
Google::AuditorBase::m_nSampleEvents
Gaudi::Property< unsigned long long > m_nSampleEvents
Definition: GoogleAuditor.cpp:266
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209

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

stop a full event audit

Definition at line 88 of file GoogleAuditor.cpp.

89 {
90 info() << " -> Stopping full audit" << endmsg;
91 std::ostringstream t;
92 t << "FULL-Events" << m_nEvts << "To" << m_nEvts + m_nSampleEvents;
93 google_after( t.str() );
94 m_inFullAudit = false;
95 m_sampleEventCount = 0;
96 }
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:112
Google::AuditorBase::m_inFullAudit
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
Definition: GoogleAuditor.cpp:277
Google::AuditorBase::m_sampleEventCount
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
Definition: GoogleAuditor.cpp:275
Google::AuditorBase::m_nEvts
unsigned long long m_nEvts
Number of events processed.
Definition: GoogleAuditor.cpp:274
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
Google::AuditorBase::m_nSampleEvents
Gaudi::Property< unsigned long long > m_nSampleEvents
Definition: GoogleAuditor.cpp:266
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:209

## Member Data Documentation

bool Google::AuditorBase::m_audit = true
| private

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

Definition at line 273 of file GoogleAuditor.cpp.

Gaudi::Property<unsigned long long> Google::AuditorBase::m_eventsToSkip
| private

Initial value:
{this, "SkipEvents", 0,
"Number of events to skip before activating the auditing"}

Definition at line 268 of file GoogleAuditor.cpp.

Gaudi::Property<int> Google::AuditorBase::m_freq {this, "ProfileFreq", -1, "The frequence to audit events. -1 means all events"}
| private

Definition at line 262 of file GoogleAuditor.cpp.

Gaudi::Property<bool> Google::AuditorBase::m_fullEventAudit
| private

Initial value:
{
this, "DoFullEventProfile", false,
"If true, instead of individually auditing components, the full event (or events) will be audited in one go"}

Definition at line 263 of file GoogleAuditor.cpp.

bool Google::AuditorBase::m_inFullAudit = false
| private

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

Definition at line 277 of file GoogleAuditor.cpp.

Gaudi::Property<std::vector<std::string> > Google::AuditorBase::m_list
| private

Initial value:
{
this, "EnableFor", {}, "Any component in this list will be audited. If empty, all will be done."}

Definition at line 260 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_nEvts = 0
| private

Number of events processed.

Definition at line 274 of file GoogleAuditor.cpp.

Gaudi::Property<unsigned long long> Google::AuditorBase::m_nSampleEvents
| private

Initial value:
{
this, "FullEventNSampleEvents", 1, "The number of events to include in a full event audit, if enabled"}

Definition at line 266 of file GoogleAuditor.cpp.

unsigned long long Google::AuditorBase::m_sampleEventCount
| private

Initial value:
=
0

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

Definition at line 275 of file GoogleAuditor.cpp.

Gaudi::Property<bool> Google::AuditorBase::m_skipSequencers
| private

Initial value:
{this, "SkipSequencers", true,
"If true, auditing will be skipped for Sequencer objects."}

Definition at line 270 of file GoogleAuditor.cpp.

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

Name of the component we are currently auditing.

Definition at line 278 of file GoogleAuditor.cpp.

Gaudi::Property<std::vector<std::string> > Google::AuditorBase::m_veto
| private

Initial value:
{
this, "DisableFor", {}, "List of component names to disable the auditing for"}

Definition at line 258 of file GoogleAuditor.cpp.

Gaudi::Property<std::vector<std::string> > Google::AuditorBase::m_when
| private

Initial value:
{
this,
"ActivateAt",
{"Initialize", "ReInitialize", "Execute", "BeginRun", "EndRun", "Finalize"},
"List of phases to activate the Auditoring during"}

Definition at line 253 of file GoogleAuditor.cpp.

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

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