Sample Code

There are two parts to the instrumentation of an application. First, you need to count the activity the application wants to track. Then you need to provide the measurement DLL which will collect the data for the performance monitor.

In this sample we will place a couple of counters in the VGA driver. This is a pretty simple case, with one counter that counts BitBlts, and another for counting TextOut calls. So we can focus on the instrumentation and ignore lots of application issues.

The source for the VGA driver is included in the Windows NT DDK, and the following sample code is also provided there. So if you want, this code can be a starting place for your own instrumentation efforts.