tbb_statistics.h
Go to the documentation of this file.
/*
Copyright (c) 2005-2020 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#ifndef _TBB_tbb_statistics_H
#define _TBB_tbb_statistics_H
#include "tbb/tbb_stddef.h"
#ifndef __TBB_STATISTICS
#define __TBB_STATISTICS 0
#endif /* __TBB_STATISTICS */
#if __TBB_STATISTICS
#include <string.h> // for memset
#define __TBB_STATISTICS_STDOUT 1
#define __TBB_STATISTICS_TOTALS_ONLY 1
#define __TBB_STATISTICS_EARLY_DUMP 1
#define GATHER_STATISTIC(x) (x)
namespace tbb {
namespace internal {
enum statistics_groups {
sg_task_allocation = 0x01,
sg_task_execution = 0x02,
sg_stealing = 0x04,
sg_affinity = 0x08,
sg_arena = 0x10,
sg_market = 0x20,
sg_prio = 0x40,
sg_prio_ex = 0x80,
// List end marker. Insert new groups only before it.
sg_end
};
const uintptr_t __TBB_ActiveStatisticsGroups = sg_task_execution | sg_stealing | sg_affinity | sg_arena | sg_market;
struct statistics_counters {
typedef long counter_type;
// Group: sg_task_allocation
// Counters in this group can have negative values as the tasks migrate across
// threads while the associated counters are updated in the current thread only
// to avoid data races
counter_type active_tasks;
counter_type free_list_length;
counter_type big_tasks;
// Group: sg_task_execution
counter_type tasks_executed;
counter_type spawns_bypassed;
// Group: sg_stealing
counter_type steals_committed;
counter_type steals_failed;
counter_type thieves_conflicts;
counter_type thief_backoffs;
// Group: sg_affinity
counter_type mails_received;
counter_type proxies_executed;
counter_type proxies_stolen;
counter_type proxies_bypassed;
counter_type affinity_ignored;
// Group: sg_arena
counter_type gate_switches;
counter_type arena_roundtrips;
// !Average concurrency level of this arena
counter_type avg_arena_concurrency;
counter_type avg_assigned_workers;
// Group: sg_market
counter_type market_roundtrips;
// Group; sg_prio
counter_type arena_prio_switches;
counter_type market_prio_switches;
counter_type arena_prio_resets;
counter_type prio_ref_fixups;
counter_type avg_arena_prio;
counter_type avg_market_prio;
// Group; sg_prio_ex
counter_type prio_winnowings;
counter_type prio_reloads;
counter_type prio_orphanings;
counter_type prio_tasks_offloaded;
counter_type prio_tasks_reloaded;
// Constructor and helpers
statistics_counters() { reset(); }
void reset () { memset( this, 0, sizeof(statistics_counters) ); }
counter_type& field ( size_t index ) { return reinterpret_cast<counter_type*>(this)[index]; }
const counter_type& field ( size_t index ) const { return reinterpret_cast<const counter_type*>(this)[index]; }
static size_t size () { return sizeof(statistics_counters) / sizeof(counter_type); }
const statistics_counters& operator += ( const statistics_counters& rhs ) {
for ( size_t i = 0; i < size(); ++i )
field(i) += rhs.field(i);
return *this;
}
}; // statistics_counters
static const size_t workers_counters_total = (size_t)-1;
static const size_t arena_counters_total = (size_t)-2;
void dump_statistics ( const statistics_counters& c, size_t id );
} // namespace internal
} // namespace tbb
#else /* !__TBB_STATISTICS */
#define GATHER_STATISTIC(x) ((void)0)
#endif /* !__TBB_STATISTICS */
#endif /* _TBB_tbb_statistics_H */
internal
Definition: _flow_graph_async_msg_impl.h:24
tbb
The graph class.
Definition: serial/tbb/parallel_for.h:46
size
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
Definition: ittnotify_static.h:109
tbb_stddef.h

Copyright © 2005-2020 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.