| The Gaudi Framework v32r1 (f65d50dc)

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 public:
22 using extends::extends;
23
25 StatusCode initialize() override;
26
28 StatusCode finalize() override;
29
30 // Handler for incident
31 void handle( const Incident& incident ) override;
32
33 protected:
34 void handleBegin();
35 void handleEnd();
36 void startProfiling();
37 void stopProfiling();
38 void dumpProfile();
39
40 private:
41 Gaudi::Property<int> m_nStartFromEvent{this, "StartFromEventN", 0, "After what event we start profiling."};
42 Gaudi::Property<std::vector<std::string>> m_startFromIncidents{
43 this, "StartFromIncidents", {}, "Incidents that trigger profiling start"};
44 Gaudi::Property<int> m_nStopAtEvent{
45 this, "StopAtEventN", 0,
46 "After what event we stop profiling. If 0 than we also profile finalization stage. Default = 0."};
47 Gaudi::Property<std::vector<std::string>> m_stopAtIncidents{
48 this, "StopAtIncidents", {}, "Incidents that trigger profiling start"};
49 Gaudi::Property<int> m_dumpPeriod{this, "DumpPeriod", 100, "Period for dumping head to a file. Default=100"};
50
52 int m_eventNumber = 0;
53
54 bool m_hasStartIncident = false;
55 bool m_hasStopIncident = false;
56
58 bool m_profiling = false;
59
61 SmartIF<IIncidentSvc> m_incidentSvc;
62 };
63 #endif // JEMALLOC_JEMALLOCPROFILESVC_H
SmartIF< IIncidentSvc >
JemallocProfileSvc::startProfiling
void startProfiling()
Utility method to start profiling with jemalloc.
Definition: JemallocProfileSvc.cpp:135
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
JemallocProfileSvc::finalize
StatusCode finalize() override
Finalizer.
Definition: JemallocProfileSvc.cpp:63
JemallocProfileSvc::m_dumpPeriod
Gaudi::Property< int > m_dumpPeriod
Definition: JemallocProfileSvc.h:49
JemallocProfileSvc
Service that enables the Jemalloc profiler on demand.
Definition: JemallocProfileSvc.h:18
JemallocProfileSvc::m_hasStopIncident
bool m_hasStopIncident
Definition: JemallocProfileSvc.h:55
JemallocProfileSvc::handle
void handle(const Incident &incident) override
Definition: JemallocProfileSvc.cpp:78
JemallocProfileSvc::handleBegin
void handleBegin()
Definition: JemallocProfileSvc.cpp:110
JemallocProfileSvc::m_eventNumber
int m_eventNumber
Current event number.
Definition: JemallocProfileSvc.h:52
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:50
JemallocProfileSvc::m_nStopAtEvent
Gaudi::Property< int > m_nStopAtEvent
Definition: JemallocProfileSvc.h:44
JemallocProfileSvc::stopProfiling
void stopProfiling()
Utility method to stop profiling with jemalloc.
Definition: JemallocProfileSvc.cpp:144
JemallocProfileSvc::m_hasStartIncident
bool m_hasStartIncident
Definition: JemallocProfileSvc.h:54
JemallocProfileSvc::m_nStartFromEvent
Gaudi::Property< int > m_nStartFromEvent
Definition: JemallocProfileSvc.h:41
JemallocProfileSvc::m_stopAtIncidents
Gaudi::Property< std::vector< std::string > > m_stopAtIncidents
Definition: JemallocProfileSvc.h:47
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:152
JemallocProfileSvc::handleEnd
void handleEnd()
Definition: JemallocProfileSvc.cpp:118
JemallocProfileSvc::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
Definition: JemallocProfileSvc.h:61
IIncidentListener.h
JemallocProfileSvc::m_startFromIncidents
Gaudi::Property< std::vector< std::string > > m_startFromIncidents
Definition: JemallocProfileSvc.h:42
JemallocProfileSvc::m_profiling
bool m_profiling
Status of the profiling.
Definition: JemallocProfileSvc.h:58