Ask a Question

Duplicate Routines entry/exit

adrian_hawryluk
Contributor

Duplicate Routines entry/exit

I don't understand.  Why can I not Start profiling when entering a function and Stop profiling when exiting the same function?  I would think that this would be a very common thing to do.  For that matter, why is there a limit of only one anyway?  I can think of other use cases, such as where I'd want to stop and generate a report at the exiting of a function.  What's up with this? Why the limitation?

5 REPLIES 5
AlexKaras
Community Hero

Hi,

 

I might do not understand your use case / scenario with full details, but aren't Triggers the feature you are looking for (https://support.smartbear.com/aqtime/docs/profiling-with/set-up-project/what-to-profile/triggers/abo...) ?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

Hi Alex,

Yes, that is what I was attempting to do and I got the error message stating that I have duplicate routines.

I've attached an image of an example.  The function I used is just one that I selected at random.start-stop-example.png

Hi,

 

error message stating that I have duplicate routines.

I think this is expected.

According to my understanding of the https://support.smartbear.com/aqtime/docs/profiling-with/set-up-project/what-to-profile/triggers/abo... help topic (How Triggers Work paragraph):

 

"When an on-trigger routine begins executing, it saves the current profiling status for its thread and enables profiling for that thread. This still applies to everything it calls. When it reaches the end of its execution (after perhaps hundreds of calls, sub-calls and sub-sub-calls), it restores the thread’s profiling status as it found it."

 

So, I think that you should disable all profiling (like it is on the screenshot you've provided), then create the On-trigger and add the target routine to it and start profiling run.

Profiling should start on function enter and stop on exit.

 

Summarizing: Delete Off-trigger and do profiling run. I hope you should get desired result.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

Interesting.  So, what would I need to do if I wanted the profiling to occur when entering one function but exiting at some other function?

Hi,

 

It might depend on your exact scenario, but I would think about Actions (https://support.smartbear.com/aqtime/docs/profiling-with/set-up-project/what-to-profile/actions/abou...) - one that enables profiling on enter and another one that disables profiling on exit.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
cancel
Showing results for 
Search instead for 
Did you mean: