22 #pragma GCC diagnostic ignored "-Wunused-function" 24 #include "ittnotify.h" 35 using extends::extends;
49 const __itt_event parent_event_ = 0 )
67 this,
"StartFromEventN", 1,
"After what event we stop profiling. If 0 than we also profile finalization stage."};
69 this,
"StopAtEventN", 0,
70 "After what event we stop profiling. If 0 than we also profile finalization stage. Default = 0."};
73 "ComponentsForTaskTypes",
75 "Algorithm name, for which intel amplifier task type will be created." 76 "By default all algorithms have a corresponding task type."};
78 "The String delimiter between sequences/algorithms names in " 79 "\"Task Type\" grouping at Amplifier. Default=\" \"."};
81 "Enable frames (needed for detecting slow events). Default=false."};
83 "Frames rate. The recommended maximum rate for calling the Frame API is " 84 "1000 frames (events) per second. A higher rate may result in large product" 85 " memory consumption and slow finalization. " 86 "You need update \"slow-frames-threshold\" and \"fast-frames-threshold\" " 87 "parameters of amplxe-cl tool to separate slow, medium and fast events. " 88 "For use frames you need to switch on \"EnableFrames\". " 133 __itt_event taskId = 0;
136 taskId = iter->second;
141 taskId = __itt_event_create( typeName.
c_str(), typeName.
size() );
148 if ( parent != NULL ) {
149 if ( parent->
event ) {
167 __itt_event_start( state.
event );
228 for (
const auto& value :
m_stack ) {
229 result += delim + value.name;
245 inSvc->
addListener(
this, IncidentType::BeginEvent );
248 inSvc->
addListener(
this, IncidentType::EndProcessing );
250 std::string str_excluded, str_included, str_eventtypes;
252 str_excluded +=
" " +
name;
255 str_included +=
" " +
name;
258 str_eventtypes +=
" " +
name;
261 if ( !m_included.empty() ) {
262 info() <<
"Included algorithms (" << m_included.size() <<
"): " << str_included <<
endmsg;
265 if ( !m_excluded.empty() ) {
266 info() <<
"Excluded algorithms (" << m_excluded.size() <<
"): " << str_excluded <<
endmsg;
269 if ( !m_algs_for_tasktypes.empty() ) {
270 info() <<
"Event types (" << m_algs_for_tasktypes.size() <<
"): " << str_eventtypes <<
endmsg;
274 domain = __itt_domain_create(
"Event loop" );
282 if ( IncidentType::BeginEvent != incident.
type() )
return;
340 __itt_frame_begin_v3(
domain, NULL );
350 __itt_frame_end_v3(
domain, NULL );
359 if ( state.
event != 0 ) {
361 __itt_event_end( state.
event );
372 }
else if ( state.
status ) {
375 if ( !
m_stack.back().status ) {
void start_profiling_component(const std::string &name)
std::map< std::string, __itt_event > TaskTypes
Gaudi::Property< int > m_nStartFromEvent
Gaudi::Property< int > m_nStopAtEvent
const std::string & type() const
Access to the incident type.
Implementation of property with value of concrete type.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
void after(StandardEventType type, INamedInterface *i, const StatusCode &sc) override
Gaudi::Property< std::vector< std::string > > m_algs_for_tasktypes
void skip_profiling_component(const std::string &name)
Gaudi::Property< std::vector< std::string > > m_included
bool isExcluded(const std::string &name) const
StatusCode initialize() override
Gaudi::Property< int > m_frames_rate
#define DECLARE_COMPONENT(type)
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
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.
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
void after(StandardEventType, INamedInterface *, const StatusCode &) override
Gaudi::Property< std::vector< std::string > > m_excluded
constexpr static const auto SUCCESS
Gaudi::Property< bool > m_enable_frames
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
Gaudi::Property< std::string > m_alg_delim
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Base class used to extend a class implementing other interfaces.
void handle(const Incident &incident) override
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.
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.
virtual const std::string & name() const =0
Retrieve the name of the instance.
The interface implemented by the IncidentSvc service.
void before(StandardEventType type, INamedInterface *i) override