13 #include <boost/foreach.hpp>
16 #include "GaudiKernel/Auditor.h"
17 #include "GaudiKernel/IAuditorSvc.h"
18 #include "GaudiKernel/GaudiException.h"
19 #include "GaudiKernel/MsgStream.h"
20 #include "GaudiKernel/IIncidentListener.h"
21 #include "GaudiKernel/IIncidentSvc.h"
25 #pragma GCC diagnostic ignored "-Wunused-function"
27 #include "ittnotify.h"
29 typedef std::map<std::string, __itt_event>
TaskTypes;
51 const __itt_event event_ = 0,
const __itt_event parent_event_ = 0):
112 bool isIncluded(
const std::string& name)
const;
113 bool isExcluded(
const std::string& name)
const;
117 std::string
stackIndent(
bool newLevel =
false)
const;
118 std::string
taskTypeName(
const std::string& component_name)
const;
124 ,m_nEvents(0), m_isStarted(false) {
127 "Names of included algorithms."
130 "Names of excluded algorithms."
133 "After what event we stop profiling. "
134 "If 0 than we also profile finalization stage."
137 "After what event we stop profiling. "
138 "If 0 than we also profile finalization stage. Default = 0."
141 "Algorithm name, for which intel amplifier task type will be created."
142 "By default all algorithms have a corresponding task type.");
144 "The String delimiter between sequences/algorithms names in "
145 "\"Task Type\" grouping at Amplifier. Default=\" \"."
148 "Enable frames (needed for detecting slow events). Default=false."
151 "Frames rate. The recommended maximum rate for calling the Frame API is "
152 "1000 frames (events) per second. A higher rate may result in large product"
153 " memory consumption and slow finalization. "
154 "You need update \"slow-frames-threshold\" and \"fast-frames-threshold\" "
155 "parameters of amplxe-cl tool to separate slow, medium and fast events. "
156 "For use frames you need to switch on \"EnableFrames\". "
169 __itt_event taskId = 0;
170 TaskTypes::const_iterator iter =
m_tasktypes.find(typeName);
172 taskId = iter->second;
177 taskId = __itt_event_create(typeName.c_str(), typeName.size());
178 m_tasktypes.insert(TaskTypes::value_type(typeName, taskId));
184 if (parent != NULL) {
206 __itt_event_start(state.
event);
260 std::stringstream
indent(std::stringstream::out);
261 indent << std::setw(
stackLevel()*2+(newLevel?2:0)) <<
" ";
268 std::string delim =
"";
271 result += delim+value.
name;
293 std::string str_excluded, str_included, str_eventtypes;
296 str_excluded +=
" " +
name;
298 BOOST_FOREACH(
const std::string& name,
m_included)
300 str_included +=
" " +
name;
305 str_eventtypes +=
" " +
name;
310 <<
"): " << str_included <<
endmsg;
315 <<
"): " << str_excluded <<
endmsg;
320 <<
"): " << str_eventtypes <<
endmsg;
324 domain = __itt_domain_create(
"Event loop");
355 const std::string&
name = i->
name();
392 __itt_frame_begin_v3(
domain, NULL);
403 __itt_frame_end_v3(
domain, NULL);
407 const std::string&
name = i->
name();
413 if (state.
event != 0) {
416 __itt_event_end(state.
event);
428 }
else if (state.
status) {