5#ifndef VALKYRIE_VALGRINDAUDITOR_H
6#define VALKYRIE_VALGRINDAUDITOR_H
12#include <boost/regex.hpp>
15#include "Gaudi/Auditor.h"
16#include "GaudiKernel/ServiceHandle.h"
17#include "GaudiKernel/IIncidentListener.h"
18#include "GAUDI_VERSION.h"
35 virtual public IIncidentListener
44 virtual void handle(
const Incident& incident )
override;
48 virtual void before(
const std::string& event,
const std::string& name,
49 const EventContext& ctx)
override;
51 virtual void after(
const std::string& event,
const std::string& name,
52 const EventContext& ctx,
const StatusCode&
sc)
override;
64 typedef std::pair<boost::regex,std::string>
NameEvt;
90 std::vector< std::pair<NameEvt,NameEvt> >
m_hooks;
92 void do_before(
const std::string& name,
const std::string& hook);
93 void do_after(
const std::string& name,
const std::string& hook);
96 bool algMatch(
const std::string& name);
Abstract interface for ValgrindSvc.
virtual StatusCode initialize() override
ValgrindAuditor(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< std::string > m_algs
List of algorithms to profile.
StatusCode decodeIntervals()
unsigned int m_eventCounter
Internal event counter for BeginEvent incident.
void do_after(const std::string &name, const std::string &hook)
virtual void after(const std::string &event, const std::string &name, const EventContext &ctx, const StatusCode &sc) override
void do_before(const std::string &name, const std::string &hook)
std::vector< std::string > m_intervals
List of auditor intervals to profile.
std::pair< boost::regex, std::string > NameEvt
Typedef for algorithm/event pair, e.g. ("MyAlg","initialize")
virtual void handle(const Incident &incident) override
Incident handler.
virtual ~ValgrindAuditor()
bool algMatch(const std::string &name)
std::vector< std::pair< NameEvt, NameEvt > > m_hooks
Internal storage of intervals.
unsigned int m_ignoreFirstNEvents
Don't profile on the first N events.
bool m_dumpAfterEachInterval
Dump profile after each interval.
ServiceHandle< IValgrindSvc > m_valSvc
Handle to ValgrindSvc.
virtual void do_beforeExecute(const std::string &name)
Start callgrind instrumentation.
virtual void do_afterExecute(const std::string &name)
Stop callgrind instrumentation.
std::vector< boost::regex > m_algsRegEx
Regular expressions for algorithm name matching.
virtual void before(const std::string &event, const std::string &name, const EventContext &ctx) override