For non-multithreaded applications, you can get profiling for a selected region of the code by turning on profiling in the middle of the run and then turning it off at a convenient location. Given the restriction that you cannot turn on profiling in the middle of the run, you can get profiling for a selected region of code with the following:
You can't set this once the program starts running
Don't want profiling for the whole application
This is OK now because it was setup before the program run. | collector sample mode [ manual | continuous ] collector profile mode [ pc_only | stack ] stop in main run collector profile mode off .... #When you reach the beginning of the interesting point: collector profile mode [ pc_only | stack ] .... #When you reach the end of the interesting point: collector profile mode off |