Forum Discussion

eminbiole's avatar
15 years ago

How to Profile Single Function + Children?

I am somewhat new to AQTime, and was hoping someone could clarify the best way to profile a single function:

I have a rather large, multi-threaded server application.  When profiling, I naturally wish to concentrate on one specific area of the larger application.  Most often, I want to profile a specific function, plus all of the child calls made within that function.  Basically, I want to start profiling when I first enter that function, and stop when I exit.  However, I'm having trouble finding an easy way to do so within AQTime.

I tried creating two actions: One that enables profiling (On Entring the function), and a second that disables profiling (On Exiting the function).  However, AQTime then reports an error that I can't have the same function with two actions.  (Even though one is on enter, and other is on exit.)

If I create an Area, I need to manually include all child routines that are called by the main function.  Even then, I wouldn't get the proper results in cases where the child (possibly shared) routines were called elsewhere in the code.

The only way I have found to accomplish my goal is to create two dummy routines in my code, StartProfiling() and StopProfiling(), and then set up two AQTime actions linked to those functions.  While this seems to work, it seems a bit inelegant, an I need to move the Start() Stop() functions around in my code and then recompile each time I wish to profile a new function.

I hope there's an easier way to concentrate on a specific function?  Any guidance or suggestions would be appreciated.