21 #ifndef _TBB_tbb_statistics_H 22 #define _TBB_tbb_statistics_H 65 #ifndef __TBB_STATISTICS 66 #define __TBB_STATISTICS 0 75 #define __TBB_STATISTICS_STDOUT 1 80 #define __TBB_STATISTICS_TOTALS_ONLY 1 86 #define __TBB_STATISTICS_EARLY_DUMP 1 88 #define GATHER_STATISTIC(x) (x) 96 enum statistics_groups {
97 sg_task_allocation = 0x01,
98 sg_task_execution = 0x02,
110 const uintptr_t __TBB_ActiveStatisticsGroups = sg_task_execution | sg_stealing | sg_affinity | sg_arena | sg_market;
115 struct statistics_counters {
116 typedef long counter_type;
124 counter_type active_tasks;
126 counter_type free_list_length;
129 counter_type big_tasks;
134 counter_type tasks_executed;
136 counter_type spawns_bypassed;
141 counter_type steals_committed;
143 counter_type steals_failed;
145 counter_type thieves_conflicts;
147 counter_type thief_backoffs;
152 counter_type mails_received;
155 counter_type proxies_executed;
157 counter_type proxies_stolen;
159 counter_type proxies_bypassed;
161 counter_type affinity_ignored;
166 counter_type gate_switches;
168 counter_type arena_roundtrips;
170 counter_type avg_arena_concurrency;
172 counter_type avg_assigned_workers;
177 counter_type market_roundtrips;
182 counter_type arena_prio_switches;
184 counter_type market_prio_switches;
186 counter_type arena_prio_resets;
188 counter_type prio_ref_fixups;
190 counter_type avg_arena_prio;
192 counter_type avg_market_prio;
197 counter_type prio_winnowings;
199 counter_type prio_reloads;
201 counter_type prio_orphanings;
203 counter_type prio_tasks_offloaded;
205 counter_type prio_tasks_reloaded;
209 statistics_counters() { reset(); }
211 void reset () { memset(
this, 0,
sizeof(statistics_counters) ); }
213 counter_type& field (
size_t index ) {
return reinterpret_cast<counter_type*>(
this)[index]; }
215 const counter_type& field (
size_t index )
const {
return reinterpret_cast<const counter_type*>(
this)[index]; }
217 static size_t size () {
return sizeof(statistics_counters) /
sizeof(counter_type); }
219 const statistics_counters& operator += (
const statistics_counters& rhs ) {
220 for (
size_t i = 0; i <
size(); ++i )
221 field(i) += rhs.field(i);
226 static const size_t workers_counters_total = (size_t)-1;
227 static const size_t arena_counters_total = (size_t)-2;
229 void dump_statistics (
const statistics_counters& c,
size_t id );
236 #define GATHER_STATISTIC(x) ((void)0)
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t size