ATLAS Offline Software
ProfilerService.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: ProfilerService.h 496380 2012-04-18 12:28:09Z ritsch $
8 #ifndef PERFMONGPERFTOOLS_PROFILERSERVICE_H
9 #define PERFMONGPERFTOOLS_PROFILERSERVICE_H
10 
11 // STL include(s):
12 #include <string>
13 
14 // Gaudi/Athena include(s):
15 #include "GaudiKernel/ServiceHandle.h"
16 #include "GaudiKernel/IIncidentListener.h"
17 #include "GaudiKernel/IIncidentSvc.h"
19 
20 // Local include(s):
22 
23 namespace GPT {
24 
37  class ProfilerService : public AthService,
38  public virtual IProfilerSvc,
39  public virtual IIncidentListener {
40 
41  public:
43  ProfilerService( const std::string& name, ISvcLocator* svcloc );
45  virtual ~ProfilerService();
46 
48  virtual StatusCode queryInterface( const InterfaceID& riid,
49  void** ppvIF );
50 
52  virtual StatusCode initialize();
54  virtual StatusCode finalize();
55 
57  virtual StatusCode startCPUProfiling( const std::string& filename );
59  virtual StatusCode stopCPUProfiling();
61  virtual bool isCPUProfilingRunning() const;
62 
64  virtual void handle( const Incident& inc );
65 
66  private:
69 
75  std::string m_profFileName;
76 
78  bool m_running;
80  std::string m_fileName;
81 
84 
85  }; // class IProfilerSvc
86 
87 } // namespace GPT
88 
89 #endif // PERFMONGPERFTOOLS_PROFILERSERVICE_H
GPT::ProfilerService::finalize
virtual StatusCode finalize()
Standard Gaudi finalization function.
Definition: ProfilerService.cxx:96
GPT::ProfilerService::stopCPUProfiling
virtual StatusCode stopCPUProfiling()
Stop the GPT profiling.
Definition: ProfilerService.cxx:142
GPT::ProfilerService::initialize
virtual StatusCode initialize()
Standard Gaudi initialization function.
Definition: ProfilerService.cxx:64
GPT::ProfilerService::queryInterface
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvIF)
Function declaring the interface(s) implemented by the service.
Definition: ProfilerService.cxx:49
GPT::ProfilerService::m_processedEvents
int m_processedEvents
Number of events processed so far.
Definition: ProfilerService.h:83
GPT::ProfilerService::m_fileName
std::string m_fileName
Name of the current profile file.
Definition: ProfilerService.h:80
GPT::IProfilerSvc
Simple interface for the profiler service.
Definition: IProfilerSvc.h:34
GPT::ProfilerService::m_controlledProfiling
bool m_controlledProfiling
Property: Is profiling controlled from the outside?
Definition: ProfilerService.h:71
GPT
Definition: IProfilerSvc.h:17
GPT::ProfilerService::m_running
bool m_running
Is the CPU profiling running at the moment?
Definition: ProfilerService.h:78
GPT::ProfilerService::~ProfilerService
virtual ~ProfilerService()
Destructor.
Definition: ProfilerService.cxx:41
GPT::ProfilerService
Implementation of the IProfilerSvc interface.
Definition: ProfilerService.h:39
IProfilerSvc.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
GPT::ProfilerService::handle
virtual void handle(const Incident &inc)
Function handling incoming incidents.
Definition: ProfilerService.cxx:182
GPT::ProfilerService::ProfilerService
ProfilerService(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi service constructor.
Definition: ProfilerService.cxx:27
GPT::ProfilerService::m_initEvent
int m_initEvent
Property: Event in which non-controlled profiling should start.
Definition: ProfilerService.h:73
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
GPT::ProfilerService::startCPUProfiling
virtual StatusCode startCPUProfiling(const std::string &filename)
Start GPT profiling.
Definition: ProfilerService.cxx:114
GPT::ProfilerService::isCPUProfilingRunning
virtual bool isCPUProfilingRunning() const
Is the GPT profiling running at the moment?
Definition: ProfilerService.cxx:170
GPT::ProfilerService::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
Definition: ProfilerService.h:68
GPT::ProfilerService::m_profFileName
std::string m_profFileName
Property: Profile file name in non-controlled profiling.
Definition: ProfilerService.h:75
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
AthService.h
ServiceHandle< IIncidentSvc >