Function Trace Profiler Tutorial: 1 - Generating Data

Applies to AQTime 8.81, last modified on January 18, 2022

To illustrate the purpose of the Function Trace profiler, we will use a sample application that is supplied with AQTime, Cycles.

Managed code

Microsoft Visual Studio 2013 projects:

<AQTime Samples>\Managed\VS2013\Performance\CS  -  Microsoft Visual C# .NET

<AQTime Samples>\Managed\VS2013\Performance\VB  -  Microsoft Visual Basic .NET

<AQTime Samples>\Managed\VS2013\Performance\VC  -  Microsoft Visual C++ .NET

Microsoft Visual Studio 2005 projects:

<AQTime Samples>\Managed\VS2005\Performance\CS  -  Microsoft Visual C# .NET

<AQTime Samples>\Managed\VS2005\Performance\JS   -  Microsoft Visual J# .NET

<AQTime Samples>\Managed\VS2005\Performance\VB  -  Microsoft Visual Basic .NET

<AQTime Samples>\Managed\VS2005\Performance\VC  -  Microsoft Visual C++ .NET

Unmanaged code

<AQTime Samples>\Unmanaged\Performance\VC2013  -  Microsoft Visual C++ (Visual Studio 2013 project)

<AQTime Samples>\Unmanaged\Performance\VC2005  -  Microsoft Visual C++ (Visual Studio 2005 project)

<AQTime Samples>\Unmanaged\Performance\VB  -  Microsoft Visual Basic 6.0

<AQTime Samples>\Unmanaged\Performance\Delphi  -  Borland Delphi

<AQTime Samples>\Unmanaged\Performance\BCB  -  Borland C++Builder

Note: You can also open Visual Studio samples in later versions of Visual Studio.
On Windows Vista and later, AQTime samples are located in the <Users>\Public\Documents\AQTime 8 Samples folder. On other operating systems, the samples reside in the <Documents and Settings>\All Users\Documents\AQTime 8 Samples folder.
  • Load the sample program for your compiler in AQTime.

  • Select Function Trace Profiler from the Profilers box on the Standard toolbar.

    Select Function Trace Profiler from the AQTime > Profilers item in the main menu of Visual Studio.

    Select Function Trace Profiler from the Current Profiler submenu of Embarcadero RAD Studio’s AQTime menu.

  • Select Normal from the Profiling Mode drop-down list box that is displayed on AQTime’s Standard toolbar.

    Select Normal from the Profiling Mode drop-down list box that is displayed on Visual Studio’s AQTime toolbar.

    Click the Normal button on RAD Studio’s AQTime Profiling Modes toolbar.

  • Verify that the Enable/Disable Profiling button on the Standard toolbarin the AQTime menu of Visual Studioin the AQTime menu of RAD Studio is pressed since AQTime only profiles when this button is pressed.

Note: The Function Trace profiler logs the call routes for application functions, collects timing and hit count information. So, when profiling large applications, the profiler can generate large results. Therefore, to decrease the amount of logged data, we recommend that you create areas and use triggers. Besides, if you want to log the actual parameter values for function calls, you should add the desired routine to the area in which the Retrieve parameter values property is enabled.
  • Press the Add Area button on the Setup panel toolbar. In the Add Area dialog, specify the area name, select the including type and class level, enable the Retrieve parameter values property and press OK.

  • In the Modules pane, locate the class that corresponds to the application’s main form (depending on the compiler, it is called either Form1 or MainForm) and add it to the created area.

  • Select Options > Options from AQTime’s main menu to display the Options dialog.

    Select Tools > Options from the main menu of Visual Studio to display the Options dialog.

    Select AQTime > Options from the main menu of Embarcadero RAD Studio to display the Options dialog.

    In the dialog, select the General > Show Again FlagsAQTime > General > Show Again FlagsGeneral > Show Again Flags from the list on the left. Enable the Function Trace Profiler option in the Show profiler options when profiling starts section and press OK to save the changes and close the dialog.

  • Press Run to start profiling.

    Select AQTime > Run to start profiling. An alternative way to start profiling is to press Visual Studio’s Run button while any AQTime panel is active.

    Select AQTime > Run With Profiling to start profiling.

  • Since the Function Trace Profiler option on the Show Again Flags option page has been enabled, AQTime will call the Profiler Options dialog where you can set profiler options before profiling starts. We will modify the value of the Maximum route depth option.

    This option specifies the number of routines to be traced for each route. Since the route tracing consumes a lot of memory, by default this option is set to 0. This means the profiler does not trace the routes. To enable tracing, set any number that is greater than 0 for this option. Let’s specify 40 for this option.

  • Press Run to start profiling.

  • AQTime will launch the profiled application. Wait until the application window is displayed on the screen.

  • In Cycles, enter 10 and then press Execute. Wait while Cycles performs a series of actions.

  • Close Cycles.

In the next two steps we will analyze profiling results.

Prev     Next

See Also

Function Trace Profiler - Overview

Highlight search results