15 #include "containers.h" 25 #if TASK_SCHEDULER_PROFILER == TASK_SCHEDULER_PROFILER_ITT 30 uint32_t get_itt_error(
enum errors::type _error)
35 return __itt_suppress_threading_errors;
37 return __itt_suppress_memory_errors;
39 return __itt_suppress_all_errors;
43 inline void suppress(
enum errors::type _error)
45 __itt_suppress_push((
unsigned int)get_itt_error(_error));
48 inline void unsuppress(
enum errors::type _error)
60 return &error_instance;
68 void set_name(
const tchar_t* _name)
override;
70 void allocate_begin(
size_t _size,
bool _initialized)
override 74 __itt_heap_allocate_begin(heap, _size, _initialized ? 1 : 0);
77 void allocate_end(
void** _memory_allocation,
size_t _size,
bool _initialized)
override 81 __itt_heap_allocate_end(heap, _memory_allocation, _size, _initialized ? 1 : 0);
85 __itt_heap_function heap;
88 template<
typename TKey>
95 void memory_itt::set_name(
const tchar_t* _name)
97 super::set_name(_name);
98 const tchar_t* domain_name = domain::instance<domain>()->name;
99 heap = __itt_heap_function_create(_name, domain_name);
106 void set_name(
const tchar_t* _name)
override 108 super::set_name(_name);
109 itt_domain = __itt_domain_create(_name);
112 super::handle operator* ()
override {
113 return (super::handle)itt_domain;
116 __itt_domain* get_domain()
const 118 ts_assert(itt_domain);
123 __itt_domain* itt_domain;
126 template <
class TKey>
127 static domain* domain::instance()
136 typedef __itt_string_handle* handle;
140 string_handle = __itt_string_handle_create(_name);
143 typename handle& operator* ()
145 return string_handle;
148 __itt_string_handle* string_handle;
155 typedef __itt_id handle;
157 id(
const tchar_t* _name)
160 itt_id = __itt_id_make(reinterpret_cast<void*>(const_cast<tchar_t*>(_name)),
thread_unique_number);
161 __itt_id_create((get_as<domain, domain_itt>()->get_domain()), itt_id);
164 typename handle& operator* ()
175 function task_function;
180 task_param(
function _func,
const tchar_t* _task_id,
const tchar_t* _parent_task_id,
const tchar_t* _task_name)
181 : task_function(_func)
183 , parent_task_id(_parent_task_id)
184 , task_name(_task_name)
199 if (*_param.task_function)
201 __itt_task_begin_fn((get_as<domain, domain_itt>()->get_domain()), *_param.task_id, *_param.parent_task_id, *_param.task_function);
205 __itt_task_begin((get_as<domain, domain_itt>()->get_domain()), *_param.task_id, *_param.parent_task_id, *_param.task_name);
212 __itt_task_end((get_as<domain, domain_itt>()->get_domain()));
thread_local thread_num_t thread_unique_number
The thread unique number
Definition: globals.h:72
Definition: profileitt.h:102
Class stl_allocator.
Definition: allocator.h:16
Definition: profilebase.h:212
Definition: profilebase.h:101
Definition: profilebase.h:128
Definition: profileitt.h:63
Class scoped_enter_exit.
Definition: utils.h:140
Definition: profileitt.h:153
Definition: profileitt.h:26
Definition: profileitt.h:188
Definition: profilebase.h:80
Definition: profileitt.h:133
Definition: profileitt.h:173