|
ATLAS Offline Software
|
#include <ValgrindSvc.h>
Definition at line 29 of file ValgrindSvc.h.
◆ ValgrindSvc()
ValgrindSvc::ValgrindSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
Constructor with parameters:
Definition at line 35 of file ValgrindSvc.cxx.
37 base_class(
name, pSvcLocator),
44 declareProperty(
"ProfiledAlgs",
m_algs,
45 "List of profiled algorithms" );
48 "Intervals to profile (e.g. 'MyAlg.initialize:MyAlg.finalize'" );
51 "Dump separate profile after each event" );
54 "Dump separate profile after each interval in ProfiledIntervals" );
57 "List of incidents on which to dump a profile");
60 "Do not profile the first N events");
◆ ~ValgrindSvc()
ValgrindSvc::~ValgrindSvc |
( |
| ) |
|
|
virtual |
◆ callgrindDumpStats()
void ValgrindSvc::callgrindDumpStats |
( |
std::ostream & |
out | ) |
|
|
overridevirtual |
Dump callgrind profiling stats.
Definition at line 194 of file ValgrindSvc.cxx.
196 CALLGRIND_DUMP_STATS;
◆ callgrindStartInstrumentation()
void ValgrindSvc::callgrindStartInstrumentation |
( |
| ) |
|
|
overridevirtual |
Start callgrind instrumentation.
Definition at line 179 of file ValgrindSvc.cxx.
181 CALLGRIND_START_INSTRUMENTATION;
◆ callgrindStopInstrumentation()
void ValgrindSvc::callgrindStopInstrumentation |
( |
| ) |
|
|
overridevirtual |
Stop callgrind instrumentation.
Definition at line 184 of file ValgrindSvc.cxx.
186 CALLGRIND_STOP_INSTRUMENTATION;
◆ callgrindToggleCollect()
void ValgrindSvc::callgrindToggleCollect |
( |
| ) |
|
|
overridevirtual |
Toggle callgrind event collection.
Definition at line 189 of file ValgrindSvc.cxx.
191 CALLGRIND_TOGGLE_COLLECT;
◆ finalize()
StatusCode ValgrindSvc::finalize |
( |
| ) |
|
|
overridevirtual |
◆ handle()
void ValgrindSvc::handle |
( |
const Incident & |
incident | ) |
|
|
overridevirtual |
incident service handle for Begin/EndEvent
Definition at line 128 of file ValgrindSvc.cxx.
134 if ( inc.type() == IncidentType::BeginEvent ) {
137 ATH_MSG_DEBUG (
"[BeginEvent] Callgrind instrumentation ON.");
144 if ( useEventIncident ) {
161 <<
" after incident [" << inc.type() <<
"].");
◆ initialize()
StatusCode ValgrindSvc::initialize |
( |
| ) |
|
|
overridevirtual |
Gaudi Service Implementation.
Definition at line 70 of file ValgrindSvc.cxx.
74 ATH_MSG_INFO (
"My process ID is [" << System::procID() <<
"]");
76 const bool insideValgrind =
static_cast<bool>(RUNNING_ON_VALGRIND);
77 if ( insideValgrind ) {
78 ATH_MSG_INFO (
"=== Running from inside Valgrind ! Hi there! ===");
89 makeAuditor(
"ValgrindAuditor",auditorSvc()).ignore();
91 if ((auditorSvc()==0) || auditorSvc()->getAuditor(
"ValgrindAuditor")==0) {
93 return StatusCode::FAILURE;
103 incSvc->addListener(
this, IncidentType::BeginEvent );
104 incSvc->addListener(
this, IncidentType::EndEvent );
107 incSvc->addListener(
this, incident );
110 return StatusCode::SUCCESS;
◆ makeAuditor()
StatusCode ValgrindSvc::makeAuditor |
( |
const std::string & |
audName, |
|
|
IAuditorSvc * |
audSvc |
|
) |
| |
|
private |
helper method to create auditors
Definition at line 208 of file ValgrindSvc.cxx.
213 return StatusCode::FAILURE;
216 if ( 0 != audSvc->getAuditor( audName ) ) {
218 << audName <<
"]... good.");
219 return StatusCode::SUCCESS;
222 const std::string
propName =
"Auditors";
223 IProperty * audSvcProp =
dynamic_cast<IProperty*
>(audSvc);
225 if ( 0 == audSvcProp ) {
226 ATH_MSG_ERROR (
"Could not dyn-cast IAuditorSvc to an IProperty !!");
227 return StatusCode::FAILURE;
230 StringArrayProperty audNames;
231 audNames.assign( audSvcProp->getProperty(
propName) );
232 std::vector<std::string> updatedNames( audNames.value() );
233 updatedNames.push_back( audName );
234 audNames.set( updatedNames );
236 if ( !audSvcProp->setProperty( audNames ).isSuccess() ) {
238 (
"Could not add [" << audName
239 <<
"] to the list of auditors of [AuditorSvc] !!"
241 << audSvcProp->getProperty(
propName));
242 return StatusCode::FAILURE;
246 if ( 0 == audSvc->getAuditor( audName ) ) {
248 << audName <<
"] !!");
249 return StatusCode::FAILURE;
253 return StatusCode::SUCCESS;
◆ profileCount()
virtual unsigned int ValgrindSvc::profileCount |
( |
| ) |
|
|
inlineoverridevirtual |
Number of created callgrind profiles.
Definition at line 69 of file ValgrindSvc.h.
◆ valgrindDoLeakCheck()
void ValgrindSvc::valgrindDoLeakCheck |
( |
| ) |
|
|
overridevirtual |
Do a leak check now.
Definition at line 200 of file ValgrindSvc.cxx.
202 VALGRIND_DO_LEAK_CHECK;
◆ m_algs
std::vector<std::string> ValgrindSvc::m_algs |
|
private |
List of algorithms to profile If list is empty, profile between begin/end event.
Definition at line 88 of file ValgrindSvc.h.
◆ m_dumpAfterEachEvent
bool ValgrindSvc::m_dumpAfterEachEvent |
|
private |
Dump separate profile after each event.
Definition at line 95 of file ValgrindSvc.h.
◆ m_dumpAfterEachInterval
bool ValgrindSvc::m_dumpAfterEachInterval |
|
private |
Dump separate profile after each interval.
Definition at line 98 of file ValgrindSvc.h.
◆ m_dumpAfterIncident
std::vector<std::string> ValgrindSvc::m_dumpAfterIncident |
|
private |
List of incidents on which to create a profile dump.
Definition at line 104 of file ValgrindSvc.h.
◆ m_eventCounter
unsigned int ValgrindSvc::m_eventCounter |
|
private |
Internal event counter for BeginEvent incident.
Definition at line 107 of file ValgrindSvc.h.
◆ m_ignoreFirstNEvents
unsigned int ValgrindSvc::m_ignoreFirstNEvents |
|
private |
Don't profile on the first N events.
Definition at line 101 of file ValgrindSvc.h.
◆ m_intervals
std::vector<std::string> ValgrindSvc::m_intervals |
|
private |
List of auditor intervals to profile Syntax: "MessageSvc.initialize:MessageSvc.finalize".
Definition at line 92 of file ValgrindSvc.h.
◆ m_profileCounter
unsigned int ValgrindSvc::m_profileCounter |
|
private |
The documentation for this class was generated from the following files:
std::vector< std::string > m_dumpAfterIncident
List of incidents on which to create a profile dump.
std::string find(const std::string &s)
return a remapped string
unsigned int m_eventCounter
Internal event counter for BeginEvent incident.
#define ATH_MSG_VERBOSE(x)
std::vector< std::string > m_intervals
List of auditor intervals to profile Syntax: "MessageSvc.initialize:MessageSvc.finalize".
StatusCode makeAuditor(const std::string &audName, IAuditorSvc *audSvc)
helper method to create auditors
bool m_dumpAfterEachInterval
Dump separate profile after each interval.
unsigned int m_ignoreFirstNEvents
Don't profile on the first N events.
bool m_dumpAfterEachEvent
Dump separate profile after each event.
virtual void callgrindStartInstrumentation() override
Start callgrind instrumentation.
std::vector< std::string > m_algs
List of algorithms to profile If list is empty, profile between begin/end event.
unsigned int m_profileCounter
Counter of created profiles.
#define ATH_MSG_WARNING(x)
virtual void callgrindStopInstrumentation() override
Stop callgrind instrumentation.
virtual void callgrindDumpStats(std::ostream &out) override
Dump callgrind profiling stats.
virtual unsigned int profileCount() override
Number of created callgrind profiles.