Developer Guide and Reference

Contents

Interval Profile Dumping

The
_PGOPTI_Set_Interval_Prof_Dump()
function activates Interval Profile Dumping and sets the approximate frequency at which dumps occur. This function is used in non-terminating applications.
The prototype of the function call is listed below.
Syntax
void _PGOPTI_Set_Interval_Prof_Dump(int interval);
This function is used in non-terminating applications.
The
interval
parameter specifies the time interval at which profile dumping occurs and is measured in milliseconds. For example, if interval is set to 5000, then a profile dump and reset will occur approximately every 5 seconds. The interval is approximate because the time-check controlling the dump and reset is only performed upon entry to any instrumented function in your application.
Setting the interval to zero or a negative number will disable interval profile dumping, and setting a very small value for the interval may cause the instrumented application to spend nearly all of its time dumping profile information. Be sure to set interval to a large enough value so that the application can perform actual work and substantial profile information is collected.
The following example demonstrates one way of using interval profile dumping in non-terminating code.
Example
#include <stdio.h> // The next include is to access // _PGOPTI_Set_Interval_Prof_Dump_All #include <pgouser.h> int returnValue() { return 100; } int main() { int ans; printf("CTRL-C to quit.\n"); _PGOPTI_Set_Interval_Prof_Dump(5000); while (1) ans = returnValue(); }
You can compile the code shown above by entering commands similar to the following: