8#include <google/profiler.h>
10#include <gperftools/profiler.h>
28 : base_class( name, svcloc ),
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;
107 ATH_MSG_INFO(
"Starting CPU profiling using output file: " << filename );
118 return StatusCode::SUCCESS;
132 <<
"CPU profiling not running at the time of call";
133 return StatusCode::RECOVERABLE;
145 return StatusCode::SUCCESS;
178 <<
"Could not stop the CPU profiling";
192 <<
"Could not start the CPU profiling";
#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.
virtual ~ProfilerService()
Destructor.
bool m_running
Is the CPU profiling running at the moment?
virtual StatusCode stopCPUProfiling() override
Stop the GPT profiling.
virtual StatusCode finalize() override
Standard Gaudi finalization function.
virtual bool isCPUProfilingRunning() const override
Is the GPT profiling running at the moment?
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
int m_initEvent
Property: Event in which non-controlled profiling should start.
std::string m_fileName
Name of the current profile file.
ProfilerService(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi service constructor.
virtual StatusCode startCPUProfiling(const std::string &filename) override
Start GPT profiling.
virtual void handle(const Incident &inc) override
Function handling incoming incidents.
int m_processedEvents
Number of events processed so far.
bool m_controlledProfiling
Property: Is profiling controlled from the outside?
virtual StatusCode initialize() override
Standard Gaudi initialization function.
std::string m_profFileName
Property: Profile file name in non-controlled profiling.
static const std::string ENDEVTLOOP_INCIDENT_NAME
static const std::string BEGINEVENT_INCIDENT_NAME