ATLAS Offline Software
|
Implementation of the IProfilerSvc interface. More...
#include <ProfilerService.h>
Public Member Functions | |
ProfilerService (const std::string &name, ISvcLocator *svcloc) | |
Standard Gaudi service constructor. More... | |
virtual | ~ProfilerService () |
Destructor. More... | |
virtual StatusCode | initialize () override |
Standard Gaudi initialization function. More... | |
virtual StatusCode | finalize () override |
Standard Gaudi finalization function. More... | |
virtual StatusCode | startCPUProfiling (const std::string &filename) override |
Start GPT profiling. More... | |
virtual StatusCode | stopCPUProfiling () override |
Stop the GPT profiling. More... | |
virtual bool | isCPUProfilingRunning () const override |
Is the GPT profiling running at the moment? More... | |
virtual void | handle (const Incident &inc) override |
Function handling incoming incidents. More... | |
Private Attributes | |
ServiceHandle< IIncidentSvc > | m_incidentSvc |
Handle to the incident service. More... | |
bool | m_controlledProfiling |
Property: Is profiling controlled from the outside? More... | |
int | m_initEvent |
Property: Event in which non-controlled profiling should start. More... | |
std::string | m_profFileName |
Property: Profile file name in non-controlled profiling. More... | |
bool | m_running |
Is the CPU profiling running at the moment? More... | |
std::string | m_fileName |
Name of the current profile file. More... | |
int | m_processedEvents |
Number of events processed so far. More... | |
Implementation of the IProfilerSvc interface.
This service should be the only component talking directly with the GPT functions. Every other component should interact with GPT through this service.
Definition at line 33 of file ProfilerService.h.
GPT::ProfilerService::ProfilerService | ( | const std::string & | name, |
ISvcLocator * | svcloc | ||
) |
|
virtual |
Destructor.
Definition at line 41 of file ProfilerService.cxx.
|
overridevirtual |
|
overridevirtual |
Function handling incoming incidents.
The event loop is profiled by listening to incidents coming from the event loop manager.
This function is called every time an "interesting" incident happens.
inc | The incident that happened |
Definition at line 167 of file ProfilerService.cxx.
|
overridevirtual |
|
overridevirtual |
Is the GPT profiling running at the moment?
This function can be used to ask the service whether CPU profiling is running at the moment.
true
if the profiling is running at the moment, false
otherwise Definition at line 155 of file ProfilerService.cxx.
|
overridevirtual |
Start GPT profiling.
This function can be used to start the profiling, collecting the data into a file with the specified name.
filename | Name of the GPT profile file |
StatusCode::SUCCESS
if the operation was successful, something else otherwise Definition at line 99 of file ProfilerService.cxx.
|
overridevirtual |
Stop the GPT profiling.
This function should be called to stop the CPU profiling.
StatusCode::SUCCESS
if the operation was successful, something else otherwise Definition at line 127 of file ProfilerService.cxx.
|
private |
Property: Is profiling controlled from the outside?
Definition at line 63 of file ProfilerService.h.
|
private |
Name of the current profile file.
Definition at line 72 of file ProfilerService.h.
|
private |
Handle to the incident service.
Definition at line 60 of file ProfilerService.h.
|
private |
Property: Event in which non-controlled profiling should start.
Definition at line 65 of file ProfilerService.h.
|
private |
Number of events processed so far.
Definition at line 75 of file ProfilerService.h.
|
private |
Property: Profile file name in non-controlled profiling.
Definition at line 67 of file ProfilerService.h.
|
private |
Is the CPU profiling running at the moment?
Definition at line 70 of file ProfilerService.h.