6#include "GaudiKernel/INamedInterface.h"
15 ISvcLocator* pSvcLocator ):
16 Auditor( name, pSvcLocator ),
20 declareProperty(
"ProfiledAlgs",
m_algs,
21 "List of profiled algorithms." );
32 return StatusCode::FAILURE;
36 const IProperty* vtuneProfSvcProp =
dynamic_cast<const IProperty*
>(&(*m_vtuneProfilerSvc));
37 if ( !vtuneProfSvcProp ) {
38 msgStream() << MSG::ERROR
39 <<
"Could not retrieve IProperty interface to VTuneProfilerService."
41 return StatusCode::FAILURE;
44 std::vector<std::string> props2Copy = {
"ProfiledAlgs" };
45 for(
auto& prop : props2Copy) {
46 if ( !
setProperty(vtuneProfSvcProp->getProperty(prop)) ) {
47 msgStream() << MSG::ERROR
48 <<
"Cannot set " << prop <<
" property."
50 return StatusCode::FAILURE;
54 return StatusCode::SUCCESS;
63 for(
auto& val :
m_algs ) {
64 if ( event == IAuditor::Execute && name == val ) {
66 msgStream() << MSG::ERROR
67 <<
"Could not resume the profiling from the auditor"
80 for(
auto& val :
m_algs ) {
81 if ( event == IAuditor::Execute && name == val ) {
83 msgStream() << MSG::ERROR
84 <<
"Could not pause the profiling from the auditor"
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
virtual void after(const std::string &event, const std::string &name, const EventContext &, const StatusCode &) override
virtual void before(const std::string &event, const std::string &name, const EventContext &) override
Implement inherited methods from Auditor.
virtual StatusCode initialize() override
Gaudi hooks.
std::vector< std::string > m_algs
Property: List of algorithms to profile.
VTuneAuditor(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ServiceHandle< IVTuneProfilerSvc > m_vtuneProfilerSvc
Handle to VTuneProfilerSvc.