To simplify the use of user-defined states, a new interface has been introduced for Intel® Trace Collector. It manages the symbol handles automatically, freeing the user from the task of assigning and keeping track of symbol handles, and has a reduced number of arguments. Furthermore, the performance of the new routines has been optimized, reducing the overhead of recording state changes.
To define a new symbol, first create the respective activity by calling the VT_classdef() routine. A handle for that activity is returned, and the symbol can be defined with it by calling VT_funcdef(). The returned symbol handle is passed, for example, to VT_enter() to record a state entry event.
int VT_classdef (const char * classname, int * classhandle)
Allocates a handle for a class name.
The classname may consist of several components separated by a colon :. Leading and trailing colons are ignored. Several colons in a row are treated as just one separator.
VTCLASSDEF(classname, classhandle, ierr)
classname name of the class
classhandle the int it points to is set by Intel® Trace Collector
Returns error code.
int VT_funcdef (const char * symname, int classhandle, int * statehandle)
Allocates a handle for a state.
The symname may consist of several components separated by a colon :. If that's the case, then these become the parent class(es). Leading and trailing colons are ignored. Several colons in a row are treated as just one separator.
This is a replacement for VT_symdef() which doesn't require the application to provide a unique numeric handle.
VTFUNCDEF(symname, classhandle, statehandle, ierr)
symname name of the symbol
classhandle handle for the class this symbol belongs to, created with VT_classdef(), or VT_NOCLASS, which is an alias for "Application" if the symname doesn't contain a class name and ignored otherwise
statehandle the integer it points to is set by Intel® Trace Collector
Returns error code
special value for VT_funcdef() - put function into the default class Application.