AQTime supports profiling of executables that work as the operating system’s services. This topic explains how you can profile these applications with AQTime.
Profiling Procedure
To profile your service application with AQTime, follow these steps:
-
Compile your service application in your development tool, for example, Microsoft Visual Studio or Borland Delphi. See How AQTime Profilers Use Metadata and Debug Information to decide whether to include debug information.
-
Register your service application as a service. Your service must be displayed in the Control Panel > Administrative Tools > Services dialog.
-
Create an AQTime project and add the executable module of your service to the Setup panel (see Selecting Applications and Modules to Profile).
-
Select Service from the Profiling Mode drop-down list box that is displayed on AQTime’s Standard toolbar.Select Service from the Profiling Mode drop-down list box that is displayed on Visual Studio’s AQTime toolbar.Click the Service button on RAD Studio’s AQTime Profiling Modes toolbar.
-
Select the desired profiler and press Run to start profiling.Choose the desired profiler from the AQTime menu and select AQTime > Run (or select Debug > Run while one of AQTime panels is active) to start profiling.Choose the desired profiler from the AQTime > Current Profiler submenu and select AQTime > Run With Profiling to start profiling.
-
If the executable file contains multiple services, AQTime displays the Select Service dialog. Select the service you wish to profile and click OK.
If you need to start multiple services from the same executable during profiling, you will need to launch the other services manually.
-
AQTime will start your service or, if it is already running, restart it (so, it will be running in debug mode under AQTime). The corresponding messages will be posted to the Event View.
-
Test your service application according to your needs.
-
When your tests are complete, select Run > Get Results from AQTime’s main menuselect AQTime > Get Results from Visual Studio’s main menuselect AQTime > Get Results from RAD Studio’s main menu to obtain profiling results. Another way to obtain profiling results is to create an action that will tell AQTime to generate the results. See Getting Results During Profiling for more information. The results are also generated if stop the service via the Service Control Manager dialog. If you do not want to stop the service you can use the Get Results menu item or an action.
Profiling Services That Start Slowly
When a service starts, the operating system’s Service Control Manager waits for the service’s response within a certain time period (by default, 30 seconds). If the service does not respond within this period, the Service Control Manager terminates the service process, and AQTime reports that the service does not respond to the system in a timely fashion (you can find this message in the Event View panel).
A possible solution is to increase the system’s default timeout, so that the Service Control Manager waits for the service longer. To do this, modify the Windows Registry:
-
Open the Registry editor.
-
Add a new value of the DWORD type to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control key.
-
Name the value ServicesPipeTimeout. The value data specifies the number of seconds the Service Control Manager should wait for the service response during the service startup.
Note: The maximum value you can use is 60 seconds. AQTime does not profile services that start longer.
Known Issue
Due to the specifics of functioning of Windows 10, the Service profiling mode does not work on this operating system (AQTime is unable to launch the profiled service when you start profiling).
To work around this issue, run the service in any other way outside AQTime, and then use the “attach to proces” feature to attach to the service and to profile it.