Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

Function Timing

If function timings are enabled by the DIAGNOSTIC SNAPSHOT_WORKTIME option or by the ctPSStimeWorkOn opcode, system and user snapshots have a variable region comprised of an array of ctWRKSTT structures:

typedef struct wrkstt {

ULONG fnc; /* function # used during compression of stats */

ULONG cnt; /* function call count */

LONG8 tim; /* high resolution elapsed function time^ */

} ctWRKSTT, ctMEM * pctWRKSTT;

The first such structure in the array is a summary: its fnc member is zero, and the cnt member indicates the number of actual functions that had non-zero call counts, and the tim member has the total of all the elapsed times for all the functions. Even if the output buffer (for an on-demand snapshot with results returned directly) is too small to hold all the function-timing results, the summary is “complete.” The varlen member of the main structure indicates how many bytes of variable information have been returned. The contents member of the main structure will have the ctSNAPSHOTtruncated bit turned on if information had to be truncated.

Each subsequent entry in the array holds a function number, a call count, and a total elapsed time in the function.