16 int mallctl(
const char *
name,
void *oldp,
size_t *oldlenp,
void *newp,
size_t newlen);
33 static const std::string serviceName =
"IncidentSvc";
36 error() <<
"Cannot retrieve " << serviceName <<
endmsg;
64 info() <<
"Stop profiling trigger was specified but no start. Defaulting to first events" <<
endmsg;
80 return base_class::finalize();
91 if (IncidentType::BeginEvent == incident.
type())
94 }
else if (IncidentType::EndEvent == incident.
type())
104 if (startincident == incident.
type())
106 info() <<
"Starting Jemalloc profile at incident " 119 if (stopincident == incident.
type())
121 info() <<
"Stopping Jemalloc profile at incident " 172 info() <<
"Starting Jemalloc profile at event " 174 mallctl(
"prof.dump", NULL, NULL, NULL, 0);
191 info() <<
"Dumping Jemalloc profile at event " 193 mallctl(
"prof.dump", NULL, NULL, NULL, 0);
const std::string & type() const
Access to the incident type.
void startProfiling()
Utility method to start profiling with jemalloc.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode finalize() override
Finalizer.
Gaudi::Property< int > m_dumpPeriod
Service that enables the Jemalloc profiler on demand.
void handle(const Incident &incident) override
Destructor.
bool isFailure() const
Test for a status code of FAILURE.
int mallctl(const char *name, void *oldp, size_t *oldlenp, void *newp, size_t newlen)
#define DECLARE_COMPONENT(type)
int m_eventNumber
Current event number.
StatusCode initialize() override
Initializer.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Gaudi::Property< int > m_nStopAtEvent
void stopProfiling()
Utility method to stop profiling with jemalloc.
Gaudi::Property< int > m_nStartFromEvent
Gaudi::Property< std::vector< std::string > > m_stopAtIncidents
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Base class for all Incidents (computing events).
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
void dumpProfile()
Utility method to dump profile with jemalloc.
SmartIF< IIncidentSvc > m_incidentSvc
Pointer to the incident service.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Gaudi::Property< std::vector< std::string > > m_startFromIncidents
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
bool m_profiling
Status of the profiling.