22 #pragma GCC diagnostic ignored "-Wunused-function"
24 #include "ittnotify.h"
48 const __itt_event event_ = 0,
const __itt_event parent_event_ = 0):
119 ,m_nEvents(0), m_isStarted(false) {
122 "Names of included algorithms."
125 "Names of excluded algorithms."
128 "After what event we stop profiling. "
129 "If 0 than we also profile finalization stage."
132 "After what event we stop profiling. "
133 "If 0 than we also profile finalization stage. Default = 0."
136 "Algorithm name, for which intel amplifier task type will be created."
137 "By default all algorithms have a corresponding task type.");
139 "The String delimiter between sequences/algorithms names in "
140 "\"Task Type\" grouping at Amplifier. Default=\" \"."
143 "Enable frames (needed for detecting slow events). Default=false."
146 "Frames rate. The recommended maximum rate for calling the Frame API is "
147 "1000 frames (events) per second. A higher rate may result in large product"
148 " memory consumption and slow finalization. "
149 "You need update \"slow-frames-threshold\" and \"fast-frames-threshold\" "
150 "parameters of amplxe-cl tool to separate slow, medium and fast events. "
151 "For use frames you need to switch on \"EnableFrames\". "
164 __itt_event taskId = 0;
167 taskId = iter->second;
172 taskId = __itt_event_create(typeName.
c_str(), typeName.
size());
179 if (parent != NULL) {
201 __itt_event_start(state.
event);
265 result += delim+
value.name;
281 inSvc->
addListener(
this, IncidentType::BeginEvent);
284 inSvc->
addListener(
this, IncidentType::EndProcessing);
286 std::string str_excluded, str_included, str_eventtypes;
288 str_excluded +=
" " +
name;
291 str_included +=
" " +
name;
294 str_eventtypes +=
" " +
name;
297 if (!m_included.empty()) {
298 info() <<
"Included algorithms (" << m_included.size()
299 <<
"): " << str_included <<
endmsg;
302 if (!m_excluded.empty()){
303 info() <<
"Excluded algorithms (" << m_excluded.size()
304 <<
"): " << str_excluded <<
endmsg;
307 if (!m_algs_for_tasktypes.empty()){
308 info() <<
"Event types (" << m_algs_for_tasktypes.size()
309 <<
"): " << str_eventtypes <<
endmsg;
313 domain = __itt_domain_create(
"Event loop");
322 if (IncidentType::BeginEvent != incident.
type())
return;
381 __itt_frame_begin_v3(
domain, NULL);
392 __itt_frame_end_v3(
domain, NULL);
402 if (state.
event != 0) {
405 __itt_event_end(state.
event);
417 }
else if (state.
status) {
void start_profiling_component(const std::string &name)
std::map< std::string, __itt_event > TaskTypes
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
const std::string & type() const
Access to the incident type.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
std::vector< std::string > m_algs_for_tasktypes
void skip_profiling_component(const std::string &name)
bool isExcluded(const std::string &name) const
bool isFailure() const
Test for a status code of FAILURE.
#define DECLARE_COMPONENT(type)
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc)
virtual const std::string & name() const =0
Retrieve the name of the instance.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
std::vector< std::string > m_excluded
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
The interface implemented by any class wanting to listen to Incidents.
stack_entity(const std::string &name_, bool status_, const __itt_event event_=0, const __itt_event parent_event_=0)
This class is used for returning status codes from appropriate routines.
void after(StandardEventType, INamedInterface *, const StatusCode &) override
IntelProfilerAuditor(const std::string &name, ISvcLocator *pSvcLocator)
SmartIF< ISvcLocator > & serviceLocator() const
The standard service locator.
std::vector< stack_entity > m_stack
std::string stackIndent(bool newLevel=false) const
IInterface compliant class extending IInterface with the name() method.
std::string taskTypeName(const std::string &component_name) const
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.
const std::string & name() const override
void before(StandardEventType type, INamedInterface *i)
bool isIncluded(const std::string &name) const
std::string typeName(const std::type_info &typ)
void before(StandardEventType, INamedInterface *) override
The following methods are meant to be implemented by the child class...
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
The interface implemented by the IncidentSvc service.
std::vector< std::string > m_included
Base class from which all concrete auditor classes should be derived.
void handle(const Incident &incident)
Inform that a new incident has occurred.