The Function Trace profiler traces the hierarchy of function calls in your application. It can display function call stacks in AQTime’s Report panel or it can output profiling results into a text file or to the CodeSite tool.
If you need special processing for results, you can create a dynamic link library. AQTime loads this DLL upon the profiler start and unloads after the profiling is over. The Function Trace profiler sends information about each function call to the library, which, in its turn, performs further result processing.
This dynamic link library must export the following functions:
Tracer_OnStartProfiling function is called upon starting the Function Trace profiler. The Enabled parameter indicates whether profiling is turned on. Remember that you can switch the profiling state with the Enable/Disable Profiling toolbar and menu item or with the
EnableProfiling function (see Controlling Profiling From Application Code). If this occurs, the
Tracer_OnEnabledChanged function is called with Enabled to specify the new profiling state. When the profiling is over, the
OnStopProfiling function is called.
Tracer_OnThreadCreate function is called when a new thread is created, the Thread parameter contains the thread ID or the thread name (see Assigning Names to Threads).
Tracer_OnRoutineEnter function is called when the profiled application enters a function. The
Tracer_OnRoutineExit function is called when the application exits a function. Both functions have the same parameters that allow AQTime to identify the profiled routine:
|RoutineName||The name of the profiled routine.|
|ClassName||The name of the class where the profiled routine is declared.|
|ModuleName||The name of the module where the profiled routine is declared.|
|UnitName||The name of the linkage unit that holds the routine.|
|Thread||The ID or name of the thread that called the profiled routine.|
|Param||A pointer to the
Tracer_OnExceptionThrown function is called upon exception. The values of the RoutineName, ClassName, ModuleName, UnitName and Thread parameters specify the routine, class, module, unit and thread where the exception occurred.
For more information on how to create dynamic link libraries, see your development tool’s documentation.