Feature Only in Professional and Enterprise Editions Profiling is supported only in Visual C++ Professional and Enterprise Editions. For more information, see Visual C++ Editions.
This topic provides information about profiling Windows NT service processes.
Use the service sample from the directory samples\sdk\winnt\service (after you install this SDK sample), and follow these steps to get timing information for its service functions:
To profile Windows NT Services
__ProfilePBI=<full path of your PBI file>
__ProfilePBO=<full path of your PBO file>
Note the exact spelling and two leading underscores. If these are not correctly set, you will get messages from PROFILE.DLL warning you that these settings cannot be found.
In this example, if your compiler is on your D drive, these variables would be:
d:\...\samples\sdk\winnt\service\simple.pbi
d:\...\samples\sdk\winnt\service\simple.pbo
prep /om /ft /sf _worker_thread simple.exe
This command also sets up the code to follow the call stack from the worker_thread()
routine. By default, the profiler profiles calls from the main thread, so servicing requests from a secondary thread without specifying the /sf option will produce incomplete results. In the sample, this second thread is created by calling CreateThread( ) to service the requests. If the main thread was servicing the requests, you wouldn't need to use the /sf option.
prep /m simple
plist simple