22 # pragma GCC diagnostic ignored "-Wunused-function" 24 #include "ittnotify.h" 34 using extends::extends;
48 const __itt_event parent_event_ = 0 )
64 this,
"StartFromEventN", 1,
"After what event we stop profiling. If 0 than we also profile finalization stage."};
66 this,
"StopAtEventN", 0,
67 "After what event we stop profiling. If 0 than we also profile finalization stage. Default = 0."};
70 "ComponentsForTaskTypes",
72 "Algorithm name, for which intel amplifier task type will be created." 73 "By default all algorithms have a corresponding task type."};
75 "The String delimiter between sequences/algorithms names in " 76 "\"Task Type\" grouping at Amplifier. Default=\" \"."};
78 "Enable frames (needed for detecting slow events). Default=false."};
80 "Frames rate. The recommended maximum rate for calling the Frame API is " 81 "1000 frames (events) per second. A higher rate may result in large product" 82 " memory consumption and slow finalization. " 83 "You need update \"slow-frames-threshold\" and \"fast-frames-threshold\" " 84 "parameters of amplxe-cl tool to separate slow, medium and fast events. " 85 "For use frames you need to switch on \"EnableFrames\". " 128 __itt_event taskId = 0;
134 taskId = __itt_event_create( typeName.
c_str(), typeName.
size() );
141 if ( parent != NULL ) {
142 if ( parent->
event ) {
160 __itt_event_start( state.
event );
213 for (
const auto& value :
m_stack ) {
214 result += delim + value.name;
229 inSvc->
addListener(
this, IncidentType::BeginEvent );
232 inSvc->
addListener(
this, IncidentType::EndProcessing );
234 std::string str_excluded, str_included, str_eventtypes;
239 if ( !m_included.empty() ) {
240 info() <<
"Included algorithms (" << m_included.size() <<
"): " << str_included <<
endmsg;
243 if ( !m_excluded.empty() ) {
244 info() <<
"Excluded algorithms (" << m_excluded.size() <<
"): " << str_excluded <<
endmsg;
247 if ( !m_algs_for_tasktypes.empty() ) {
248 info() <<
"Event types (" << m_algs_for_tasktypes.size() <<
"): " << str_eventtypes <<
endmsg;
252 domain = __itt_domain_create(
"Event loop" );
259 if ( IncidentType::BeginEvent != incident.
type() )
return;
330 if ( state.
event != 0 ) {
332 __itt_event_end( state.
event );
343 }
else if ( state.
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)
constexpr static const auto SUCCESS
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
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