22 : base_class( name, svcloc ),
27 "Event in which to resume the profiling." );
29 "Event in which to pause the profiling. Negative number "
30 "profiles the entire event-loop." );
31 declareProperty(
"ProfiledAlgs",
m_algs,
32 "List of profiled algorithms." );
48 ATH_MSG_INFO(
"ResumeEvent/PauseEvent don't work in conjuction with ProfiledAlgs. " <<
49 "Execute methods of all provided algorithms will be sampled in all events." );
52 ATH_CHECK( auditorSvc()->addAuditor(
"VTuneAuditor") );
64 return StatusCode::SUCCESS;
76 return StatusCode::SUCCESS;
83 m_runner = std::make_unique< VTuneProfileRunner >();
85 return StatusCode::SUCCESS;
97 return StatusCode::SUCCESS;
106 return StatusCode::SUCCESS;
126 if ( !
m_algs.empty() )
return;
135 <<
"Could not pause the profiling";
147 std::lock_guard<std::mutex> lock(
m_mutex);
154 <<
"Could not resume the profiling";
163 std::lock_guard<std::mutex> lock(
m_mutex);
171 <<
"Could not pause the profiling";
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
#define CHECK(...)
Evaluate an expression and check for errors.
static const std::string BEGINEVENT_INCIDENT_NAME
static const std::string ENDEVENT_INCIDENT_NAME
static const std::string ENDEVTLOOP_INCIDENT_NAME
VTuneProfilerService(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi service constructor.
std::unique_ptr< VTuneProfileRunner > m_runner
Unique ptr to the VTuneProfileRunner.
int m_pauseEvent
Property: Event in which profiling should pause.
std::vector< std::string > m_algs
Property: List of algorithms to profile.
std::atomic< int > m_processedEvents
Number of events processed so far.
int m_resumeEvent
Property: Event in which profiling should start.
virtual bool isProfilingRunning() const override
Is the profiling running at the moment?
virtual void handle(const Incident &inc) override
Function handling incoming incidents.
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
virtual StatusCode resumeProfiling() override
Resume profiling.
virtual StatusCode pauseProfiling() override
Pause profiling.
virtual StatusCode initialize() override
Standard Gaudi initialization function.