|
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";
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." );
53 return StatusCode::FAILURE;
58 return StatusCode::SUCCESS;
61 return AthService::queryInterface( riid, ppvIF );
72 return StatusCode::SUCCESS;
93 return StatusCode::SUCCESS;
103 return StatusCode::SUCCESS;
133 return StatusCode::SUCCESS;
147 <<
"CPU profiling not running at the time of call";
148 return StatusCode::RECOVERABLE;
160 return StatusCode::SUCCESS;
188 if( ( inc.type() == ENDEVTLOOP_INCIDENT_NAME ) &&
193 <<
"Could not stop the CPU profiling";
202 if( ( inc.type() == BEGINEVENT_INCIDENT_NAME ) &&
207 <<
"Could not start the CPU profiling";
virtual StatusCode finalize()
Standard Gaudi finalization function.
virtual StatusCode stopCPUProfiling()
Stop the GPT profiling.
virtual StatusCode initialize()
Standard Gaudi initialization function.
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIF)
Function declaring the interface(s) implemented by the service.
int m_processedEvents
Number of events processed so far.
std::string m_fileName
Name of the current profile file.
Simple interface for the profiler service.
bool m_controlledProfiling
Property: Is profiling controlled from the outside?
bool m_running
Is the CPU profiling running at the moment?
virtual ~ProfilerService()
Destructor.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual void handle(const Incident &inc)
Function handling incoming incidents.
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.
static const InterfaceID & interfaceID()
Interface ID definition.
#define REPORT_MESSAGE(LVL)
Report a message.
#define ATH_MSG_WARNING(x)
virtual StatusCode startCPUProfiling(const std::string &filename)
Start GPT profiling.
virtual bool isCPUProfilingRunning() const
Is the GPT profiling running at the moment?
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
std::string m_profFileName
Property: Profile file name in non-controlled profiling.