| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

JemallocProfileSvc.h
Go to the documentation of this file.
1 #ifndef JEMALLOC_JEMALLOCPROFILESVC_H
2 #define JEMALLOC_JEMALLOCPROFILESVC_H 1
3
4 // Include files
5 #include "GaudiKernel/IIncidentListener.h"
6 #include "GaudiKernel/Service.h"
7
18 class JemallocProfileSvc : public extends<Service, IIncidentListener>
19 {
20
21 public:
23 using extends::extends;
24
26 StatusCode initialize() override;
27
29 StatusCode finalize() override;
30
31 // Handler for incident
32 void handle( const Incident& incident ) override;
33
35 ~JemallocProfileSvc() override = default;
36
37 protected:
38 void handleBegin();
39 void handleEnd();
40 void startProfiling();
41 void stopProfiling();
42 void dumpProfile();
43
44 private:
45 Gaudi::Property<int> m_nStartFromEvent{this, "StartFromEventN", 0, "After what event we start profiling."};
46 Gaudi::Property<std::vector<std::string>> m_startFromIncidents{
47 this, "StartFromIncidents", {}, "Incidents that trigger profiling start"};
48 Gaudi::Property<int> m_nStopAtEvent{
49 this, "StopAtEventN", 0,
50 "After what event we stop profiling. If 0 than we also profile finalization stage. Default = 0."};
51 Gaudi::Property<std::vector<std::string>> m_stopAtIncidents{
52 this, "StopAtIncidents", {}, "Incidents that trigger profiling start"};
53 Gaudi::Property<int> m_dumpPeriod{this, "DumpPeriod", 100, "Period for dumping head to a file. Default=100"};
54
56 int m_eventNumber = 0;
57
58 bool m_hasStartIncident = false;
59 bool m_hasStopIncident = false;
60
62 bool m_profiling = false;
63
65 SmartIF<IIncidentSvc> m_incidentSvc;
66 };
67 #endif // JEMALLOC_JEMALLOCPROFILESVC_H
SmartIF< IIncidentSvc >
JemallocProfileSvc::startProfiling
void startProfiling()
Utility method to start profiling with jemalloc.
Definition: JemallocProfileSvc.cpp:148
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
JemallocProfileSvc::finalize
StatusCode finalize() override
Finalizer.
Definition: JemallocProfileSvc.cpp:68
JemallocProfileSvc::m_dumpPeriod
Gaudi::Property< int > m_dumpPeriod
Definition: JemallocProfileSvc.h:53
JemallocProfileSvc
Service that enables the Jemalloc profiler on demand.
Definition: JemallocProfileSvc.h:18
JemallocProfileSvc::m_hasStopIncident
bool m_hasStopIncident
Definition: JemallocProfileSvc.h:59
JemallocProfileSvc::handle
void handle(const Incident &incident) override
Destructor.
Definition: JemallocProfileSvc.cpp:84
JemallocProfileSvc::~JemallocProfileSvc
~JemallocProfileSvc() override=default
JemallocProfileSvc::handleBegin
void handleBegin()
Definition: JemallocProfileSvc.cpp:117
JemallocProfileSvc::m_eventNumber
int m_eventNumber
Current event number.
Definition: JemallocProfileSvc.h:56
Service.h
JemallocProfileSvc::initialize
StatusCode initialize() override
Initializer.
Definition: JemallocProfileSvc.cpp:27
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
JemallocProfileSvc::m_nStopAtEvent
Gaudi::Property< int > m_nStopAtEvent
Definition: JemallocProfileSvc.h:48
JemallocProfileSvc::stopProfiling
void stopProfiling()
Utility method to stop profiling with jemalloc.
Definition: JemallocProfileSvc.cpp:158
JemallocProfileSvc::m_hasStartIncident
bool m_hasStartIncident
Definition: JemallocProfileSvc.h:58
JemallocProfileSvc::m_nStartFromEvent
Gaudi::Property< int > m_nStartFromEvent
Definition: JemallocProfileSvc.h:45
JemallocProfileSvc::m_stopAtIncidents
Gaudi::Property< std::vector< std::string > > m_stopAtIncidents
Definition: JemallocProfileSvc.h:51
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
JemallocProfileSvc::dumpProfile
void dumpProfile()
Utility method to dump profile with jemalloc.
Definition: JemallocProfileSvc.cpp:167
JemallocProfileSvc::handleEnd
void handleEnd()
Definition: JemallocProfileSvc.cpp:128
JemallocProfileSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
Definition: JemallocProfileSvc.h:65
IIncidentListener.h
JemallocProfileSvc::m_startFromIncidents
Gaudi::Property< std::vector< std::string > > m_startFromIncidents
Definition: JemallocProfileSvc.h:46
JemallocProfileSvc::m_profiling
bool m_profiling
Status of the profiling.
Definition: JemallocProfileSvc.h:62