Intel® Trace Analyzer and Collector User and Reference Guide

ID 767272
Date 3/31/2023
Document Table of Contents


int VT_countsetcallback( VT_CountCallback_t callback, void *custom, int ncounters )


Sets a callback for counter sampling for the calling thread.

The data provided by the callback is logged with the same time stamp as the event that triggered the callback. The callback must be set for each thread individually. Setting NULL disables sampling for the thread.


callback address of the callback function or NULL
custom opaque data that is passed to the callback function by the Intel® Trace Analyzer and Collector; can be used by the callback function to identify the thread or enabled counters
ncounters upper limit for the number of counters returned by the callback. It is not a problem to specify a number that is larger than the one that will be actually used, because the extra memory provided to the callback function will be reused efficiently.

Return values

Returns error code