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/Service.h"
7 
18 class JemallocProfileSvc : public extends<Service,
19  IIncidentListener> {
20 
21 public:
24 
27 
30 
31  // Handler for incident
32  void handle(const Incident &incident);
33 
35  virtual ~JemallocProfileSvc();
36 
37 protected:
38  void handleBegin();
39  void handleEnd();
40  void startProfiling();
41  void stopProfiling();
42  void dumpProfile();
43 
44 
45 private:
47  int m_nStartFromEvent; // Event to start profiling at
48  int m_nStopAtEvent; // Event to stop profiling at
49  int m_dumpPeriod; // Period at which to dump the heap
50  int m_eventNumber; // Current event number
51  std::vector<std::string> m_startFromIncidents; // Incidents to use as trigger
52  std::vector<std::string> m_stopAtIncidents; // Incidents to use as trigger
55 
56 
59 
62 };
63 #endif // JEMALLOC_JEMALLOCPROFILESVC_H
StatusCode initialize()
Initializer.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
void startProfiling()
Utility method to start profiling with jemalloc.
StatusCode finalize()
Finalizer.
Service that enables the Jemalloc profiler on demand.
std::vector< std::string > m_stopAtIncidents
STL class.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
void stopProfiling()
Utility method to stop profiling with jemalloc.
std::vector< std::string > m_startFromIncidents
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Base class for all Incidents (computing events).
Definition: Incident.h:17
void dumpProfile()
Utility method to dump profile with jemalloc.
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
JemallocProfileSvc(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
int m_nStartFromEvent
Start, End event and counter.
void handle(const Incident &incident)
Destructor.
bool m_profiling
Status of the profiling.