17 #ifndef _TBB_tbb_statistics_H 18 #define _TBB_tbb_statistics_H 61 #ifndef __TBB_STATISTICS 62 #define __TBB_STATISTICS 0 71 #define __TBB_STATISTICS_STDOUT 1 76 #define __TBB_STATISTICS_TOTALS_ONLY 1 82 #define __TBB_STATISTICS_EARLY_DUMP 1 84 #define GATHER_STATISTIC(x) (x) 92 enum statistics_groups {
93 sg_task_allocation = 0x01,
94 sg_task_execution = 0x02,
106 const uintptr_t __TBB_ActiveStatisticsGroups = sg_task_execution | sg_stealing | sg_affinity | sg_arena | sg_market;
111 struct statistics_counters {
112 typedef long counter_type;
120 counter_type active_tasks;
122 counter_type free_list_length;
125 counter_type big_tasks;
130 counter_type tasks_executed;
132 counter_type spawns_bypassed;
137 counter_type steals_committed;
139 counter_type steals_failed;
141 counter_type thieves_conflicts;
143 counter_type thief_backoffs;
148 counter_type mails_received;
151 counter_type proxies_executed;
153 counter_type proxies_stolen;
155 counter_type proxies_bypassed;
157 counter_type affinity_ignored;
162 counter_type gate_switches;
164 counter_type arena_roundtrips;
166 counter_type avg_arena_concurrency;
168 counter_type avg_assigned_workers;
173 counter_type market_roundtrips;
178 counter_type arena_prio_switches;
180 counter_type market_prio_switches;
182 counter_type arena_prio_resets;
184 counter_type prio_ref_fixups;
186 counter_type avg_arena_prio;
188 counter_type avg_market_prio;
193 counter_type prio_winnowings;
195 counter_type prio_reloads;
197 counter_type prio_orphanings;
199 counter_type prio_tasks_offloaded;
201 counter_type prio_tasks_reloaded;
205 statistics_counters() { reset(); }
207 void reset () { memset(
this, 0,
sizeof(statistics_counters) ); }
209 counter_type& field (
size_t index ) {
return reinterpret_cast<counter_type*>(
this)[index]; }
211 const counter_type& field (
size_t index )
const {
return reinterpret_cast<const counter_type*>(
this)[index]; }
213 static size_t size () {
return sizeof(statistics_counters) /
sizeof(counter_type); }
215 const statistics_counters& operator += (
const statistics_counters& rhs ) {
216 for (
size_t i = 0; i <
size(); ++i )
217 field(i) += rhs.field(i);
222 static const size_t workers_counters_total = (size_t)-1;
223 static const size_t arena_counters_total = (size_t)-2;
225 void dump_statistics (
const statistics_counters& c,
size_t id );
232 #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