|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include <google/profiler.h>
10 #include <gperftools/profiler.h>
24 static const std::string BEGINEVENT_INCIDENT_NAME =
"BeginEvent";
25 static const std::string ENDEVTLOOP_INCIDENT_NAME =
"EndEvtLoop";
28 : base_class(
name, svcloc ),
29 m_incidentSvc(
"IncidentSvc",
name ),
30 m_running( false ), m_fileName(
"" ), m_processedEvents( 0 ) {
33 "Will the service be controlled by another component?" );
35 "Event in which to start the profiling. Negative number "
36 "profiles the entire job." );
37 declareProperty(
"ProfileFileName",
m_profFileName =
"gpt.profile",
38 "Profile file name in con-controlled mode." );
57 return StatusCode::SUCCESS;
78 return StatusCode::SUCCESS;
88 return StatusCode::SUCCESS;
118 return StatusCode::SUCCESS;
132 <<
"CPU profiling not running at the time of call";
133 return StatusCode::RECOVERABLE;
145 return StatusCode::SUCCESS;
173 if( ( inc.type() == ENDEVTLOOP_INCIDENT_NAME ) &&
178 <<
"Could not stop the CPU profiling";
187 if( ( inc.type() == BEGINEVENT_INCIDENT_NAME ) &&
192 <<
"Could not start the CPU profiling";
virtual bool isCPUProfilingRunning() const override
Is the GPT profiling running at the moment?
int m_processedEvents
Number of events processed so far.
std::string m_fileName
Name of the current profile file.
bool m_controlledProfiling
Property: Is profiling controlled from the outside?
bool m_running
Is the CPU profiling running at the moment?
virtual void handle(const Incident &inc) override
Function handling incoming incidents.
virtual StatusCode finalize() override
Standard Gaudi finalization function.
virtual ~ProfilerService()
Destructor.
::StatusCode StatusCode
StatusCode definition for legacy code.
ProfilerService(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi service constructor.
#define CHECK(...)
Evaluate an expression and check for errors.
int m_initEvent
Property: Event in which non-controlled profiling should start.
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
virtual StatusCode startCPUProfiling(const std::string &filename) override
Start GPT profiling.
virtual StatusCode stopCPUProfiling() override
Stop the GPT profiling.
#define ATH_MSG_WARNING(x)
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
std::string m_profFileName
Property: Profile file name in non-controlled profiling.
virtual StatusCode initialize() override
Standard Gaudi initialization function.