Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
28 #ifdef TCMALLOC_OLD_GOOGLE_HEADERS
29 # include "google/heap-checker.h"
30 # include "google/heap-profiler.h"
31 # include "google/profiler.h"
33 # include "gperftools/heap-checker.h"
34 # include "gperftools/heap-profiler.h"
35 # include "gperftools/profiler.h"
51 using extends::extends;
55 info() <<
"Initialised" <<
endmsg;
60 inSvc->addListener(
this, IncidentType::BeginEvent );
89 info() <<
" -> Stopping full audit" <<
endmsg;
129 if ( IncidentType::BeginEvent == incident.
type() ) {
164 info() <<
"Starting Auditor for " <<
s <<
":" <<
type <<
endmsg;
168 warning() <<
"Auditor already running. Cannot be started for " <<
s <<
endmsg;
225 {
"Initialize",
"ReInitialize",
"Execute",
"Finalize" },
226 "List of phases to activate the Auditoring during" };
228 this,
"DisableFor", {},
"List of component names to disable the auditing for" };
230 this,
"EnableFor", {},
"Any component in this list will be audited. If empty, all will be done." };
233 this,
"DoFullEventProfile",
false,
234 "If true, instead of individually auditing components, the full event (or events) will be audited in one go" };
236 this,
"FullEventNSampleEvents", 1,
"The number of events to include in a full event audit, if enabled" };
238 "Number of events to skip before activating the auditing" };
240 "If true, auditing will be skipped for Sequencer objects." };
267 using AuditorBase::AuditorBase;
275 const char* profile = GetHeapProfile();
276 info() << profile <<
endmsg;
306 using AuditorBase::AuditorBase;
312 const char* HEAPCHECK = getenv(
"HEAPCHECK" );
314 fatal() <<
"Environment variable HEAPCHECK must be set to 'local'" <<
endmsg;
318 warning() <<
"Environment variable HEAPCHECK is set to " << HEAPCHECK
319 <<
" Partial Program Heap Checking is disabled" <<
endmsg;
333 if ( !
m_checker->NoLeaks() ) { warning() <<
"Leak detected for " <<
s <<
endmsg; }
361 using AuditorBase::AuditorBase;
367 ProfilerStart( (
s +
".prof" ).c_str() );
void after(CustomEventTypeRef type, const std::string &s, const StatusCode &) override
void before(CustomEventTypeRef type, const std::string &s) override
void google_before(const std::string &s) override
Start the google tool.
Gaudi::Property< int > m_freq
Gaudi::Property< bool > m_dumpProfileHeaps
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
bool m_inFullAudit
Internal flag to indicate if we are current in a full event audit.
bool alreadyRunning() override
check if we are already running the tool
virtual const std::string & name() const =0
Retrieve the name of the instance.
void before(CustomEventTypeRef type, INamedInterface *i) override
bool isPhaseEnabled(CustomEventTypeRef type) const
Check if auditing is enabled for the current processing phase.
StatusCode initialize() override
Initialize the auditor base.
Gaudi::Property< bool > m_skipSequencers
virtual void google_before(const std::string &s)=0
Start the google tool.
void beforeExecute(INamedInterface *i) override
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
void beforeInitialize(INamedInterface *i) override
void google_before(const std::string &s) override
Start the google tool.
bool isSequencer(INamedInterface *i) const
Check if the component in question is a GaudiSequencer or a Sequencer.
void afterFinalize(INamedInterface *i) override
const std::string & name() const override
void after(CustomEventTypeRef type, INamedInterface *i, const StatusCode &sc) override
void afterReinitialize(INamedInterface *i) override
void handle(const Incident &incident) override
Implement the handle method for the Incident service.
std::string getDumpName(CustomEventTypeRef type, std::string_view name) const
virtual bool alreadyRunning()=0
check if we are already running the tool
Gaudi::Property< std::vector< std::string > > m_veto
Gaudi::Property< std::vector< std::string > > m_list
bool isComponentEnabled(std::string_view name) const
Check if auditing is enabled for the given component.
Gaudi::Property< unsigned long long > m_eventsToSkip
void afterInitialize(INamedInterface *i) override
void stopAudit()
stop a full event audit
void google_after(const std::string &) override
stop the google tool
void before(StandardEventType type, const std::string &s) override
void after(StandardEventType type, const std::string &s, const StatusCode &sc) override
std::unique_ptr< HeapLeakChecker > m_checker
bool m_audit
Internal flag to say if auditing is enabled or not for the current event.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Base class used to extend a class implementing other interfaces.
Gaudi::Property< std::vector< std::string > > m_when
unsigned long long m_nEvts
Number of events processed.
void google_after(const std::string &s) override
stop the google tool
void afterExecute(INamedInterface *i, const StatusCode &s) override
virtual void google_after(const std::string &s)=0
stop the google tool
constexpr static const auto SUCCESS
void startAudit()
Start a full event audit.
Gaudi::Property< unsigned long long > m_nSampleEvents
bool alreadyRunning() override
check if we are already running the tool
StatusCode initialize() override
Initialize the auditor base.
#define DECLARE_COMPONENT(type)
Gaudi::Property< bool > m_printProfilesToLog
StatusCode finalize() override
Finalize the auditor base.
Gaudi::Property< bool > m_fullEventAudit
unsigned long long m_sampleEventCount
Internal count of the number of events currently processed during an audit.
const std::string & type() const
Access to the incident type.
std::string m_startedBy
Name of the component we are currently auditing.
constexpr static const auto FAILURE
void beforeReinitialize(INamedInterface *i) override
void beforeFinalize(INamedInterface *i) override
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Implementation of property with value of concrete type.
void google_after(const std::string &s) override
stop the google tool
void google_before(const std::string &s) override
Start the google tool.
void before(StandardEventType type, INamedInterface *i) override
bool alreadyRunning() override
check if we are already running the tool