50{
51 if ( !
m_valSvc.retrieve().isSuccess()) {
52 msgStream() << MSG::ERROR <<
"Could not retrieve the ValgrindSvc" <<
endmsg;
53 return StatusCode::FAILURE;
54 }
55
56 const IProperty* valSvcProp = dynamic_cast<const IProperty*>(&(*m_valSvc));
57 if ( !valSvcProp ) {
58 msgStream() << MSG::ERROR
59 << "Could not retrieve IProperty interface to ValgrindSvc."
61 return StatusCode::FAILURE;
62 }
63
64
66
67 msgStream() << MSG::VERBOSE
68 <<
"Initializing " <<
name() <<
"..."
70
71
73 "ProfiledIntervals",
74 "IgnoreFirstNEvents",
75 "DumpAfterEachInterval"};
76
77 for( std::string prop : properties ) {
78 if ( !
setProperty(valSvcProp->getProperty(prop)) ) {
79 msgStream() << MSG::ERROR <<
"Cannot set " << prop <<
" property." <<
endmsg;
80 return StatusCode::FAILURE;
81 }
82 }
83
84
86
87
88 for(
const std::string&
re :
m_algs ) {
89 try {
91 }
92 catch ( const boost::regex_error& ) {
93 msgStream() << MSG::ERROR <<
"Ignoring invalid regular expression: " <<
re <<
endmsg;
94 }
95 }
96
97 if ( msgLevel() <= MSG::INFO ) {
98 std::ostringstream
out;
101 std::ostream_iterator<std::string>( out, " " ) );
103 msgStream() << MSG::INFO <<
"Profiled algorithms: " <<
out.str() <<
endmsg;
104
108 std::ostream_iterator<std::string>( out, " " ) );
110 msgStream() << MSG::INFO <<
"Profiled intervals: " <<
out.str() <<
endmsg;
111 }
112
115 msgStream() << MSG::ERROR <<
"Syntax error in ProfiledIntervals" <<
endmsg;
116 return StatusCode::FAILURE;
117 }
118 }
119
120
121 ServiceHandle<IIncidentSvc> incSvc(
"IncidentSvc", this->
name());
122 if ( !incSvc.retrieve().isSuccess() ) {
123 msgStream() << MSG::ERROR <<
"Unable to get the IncidentSvc" <<
endmsg;
124 return StatusCode::FAILURE;
125 }
126
127 const long prio = std::numeric_limits<long>::max();
128
129 incSvc->addListener( this, IncidentType::BeginEvent, prio );
130
131 for(
const std::pair<NameEvt,NameEvt>& h :
m_hooks ) {
132
133 if (
h.first.second==
"incident" ) incSvc->addListener(
this,
h.first.first.str(), prio );
134 if (
h.second.second==
"incident" ) incSvc->addListener(
this,
h.second.first.str(), prio );
135 }
136
137 return StatusCode::SUCCESS;
138}
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
StatusCode decodeIntervals()