ATLAS Offline Software
VTuneProfilerService.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef VTUNE_PROFILERSERVICE_H
6 #define VTUNE_PROFILERSERVICE_H
7 
8 // STD include(s):
9 #include <atomic>
10 #include <memory>
11 #include <vector>
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):
21 #include "VTuneProfileRunner.h"
23 
24 // Fwd declerations
25 class IAuditorSvc;
26 
27 class VTuneProfilerService : public extends<AthService,
28  IVTuneProfilerSvc,
29  IIncidentListener> {
30 
31  public:
32 
34  VTuneProfilerService( const std::string& name, ISvcLocator* svcloc );
35 
37  virtual StatusCode initialize() override;
38 
40  virtual StatusCode resumeProfiling() override;
41 
43  virtual StatusCode pauseProfiling() override;
44 
46  virtual bool isProfilingRunning() const override;
47 
49  virtual void handle( const Incident& inc ) override;
50 
51  private:
52 
54  StatusCode makeAuditor (const std::string& audName, IAuditorSvc* audSvc);
55 
58 
61 
64 
66  std::vector<std::string> m_algs;
67 
69  std::unique_ptr< VTuneProfileRunner > m_runner;
70 
72  std::atomic<int> m_processedEvents;
73 
75 
76 }; // class IVTuneProfilerSvc
77 
78 #endif // VTUNE_PROFILERSERVICE.H
VTuneProfilerService::isProfilingRunning
virtual bool isProfilingRunning() const override
Is the profiling running at the moment?
Definition: VTuneProfilerService.cxx:123
VTuneProfileRunner.h
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
VTuneProfilerService::m_incidentSvc
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle to the incident service.
Definition: VTuneProfilerService.h:57
VTuneProfilerService::pauseProfiling
virtual StatusCode pauseProfiling() override
Pause profiling.
Definition: VTuneProfilerService.cxx:102
VTuneProfilerService::m_processedEvents
std::atomic< int > m_processedEvents
Number of events processed so far.
Definition: VTuneProfilerService.h:72
VTuneProfilerService::resumeProfiling
virtual StatusCode resumeProfiling() override
Resume profiling.
Definition: VTuneProfilerService.cxx:81
VTuneProfilerService::m_resumeEvent
int m_resumeEvent
Property: Event in which profiling should start.
Definition: VTuneProfilerService.h:60
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
VTuneProfilerService::m_mutex
std::mutex m_mutex
Definition: VTuneProfilerService.h:74
VTuneProfilerService
Definition: VTuneProfilerService.h:29
VTuneProfilerService::VTuneProfilerService
VTuneProfilerService(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi service constructor.
Definition: VTuneProfilerService.cxx:21
VTuneProfilerService::handle
virtual void handle(const Incident &inc) override
Function handling incoming incidents.
Definition: VTuneProfilerService.cxx:132
VTuneProfilerService::m_pauseEvent
int m_pauseEvent
Property: Event in which profiling should pause.
Definition: VTuneProfilerService.h:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
VTuneProfilerService::initialize
virtual StatusCode initialize() override
Standard Gaudi initialization function.
Definition: VTuneProfilerService.cxx:39
VTuneProfilerService::makeAuditor
StatusCode makeAuditor(const std::string &audName, IAuditorSvc *audSvc)
Helper method to create auditors.
Definition: VTuneProfilerService.cxx:197
VTuneProfilerService::m_runner
std::unique_ptr< VTuneProfileRunner > m_runner
Unique ptr to the VTuneProfileRunner.
Definition: VTuneProfilerService.h:69
AthService.h
VTuneProfilerService::m_algs
std::vector< std::string > m_algs
Property: List of algorithms to profile.
Definition: VTuneProfilerService.h:66
IVTuneProfilerSvc.h
ServiceHandle< IIncidentSvc >