tbb_statistics.h File Reference
`#include "tbb/tbb_stddef.h"`
Include dependency graph for tbb_statistics.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Macros

#define | __TBB_STATISTICS 0
#define | GATHER_STATISTIC(x) ((void)0)

## Macro Definition Documentation

## __TBB_STATISTICS

#define __TBB_STATISTICS 0

This file defines parameters of the internal statistics collected by the TBB library (currently by the task scheduler only).

Statistics is accumulated separately in each thread and is dumped when the scheduler instance associated with the given thread is destroyed. For apps with multiple master threads or with the same master repeatedly initializing and then deinitializing task scheduler this results in TBB workers statistics getting inseparably mixed.

Therefore statistics is accumulated in arena slots, and should be dumped when arena is destroyed. This separates statistics collected for each scheduler activity region in each master thread.

With the current RML implementation (TBB 2.2, 3.0) to avoid complete loss of statistics data during app shutdown (because of lazy workers deinitialization logic) set __TBB_STATISTICS_EARLY_DUMP macro to write the statistics at the moment a master thread deinitializes its scheduler. This may happen a little earlier than the moment of arena destruction resulting in the following undesired (though usually tolerable) effects:

- a few events related to unsuccessful stealing or thread pool activity may be lost,
- statistics may be substantially incomplete in case of FIFO tasks used in the FAF mode.

Macro __TBB_STATISTICS_STDOUT and global variable __TBB_ActiveStatisticsGroups defined below can be used to configure the statistics output.

To add new counter: 1) Insert it into the appropriate group range in statistics_counters; 2) Insert the corresponding field title into StatFieldTitles (preserving relative order of the fields).

To add new counters group: 1) Insert new group bit flag into statistics_groups; 2) Insert the new group title into StatGroupTitles (preserving relative order of the groups). 3) Add counter belonging to the new group as described above

Definition at line 62 of file tbb_statistics.h.

## GATHER_STATISTIC

#define GATHER_STATISTIC | ( |  | x | ) | ((void)0)

Definition at line 232 of file tbb_statistics.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.