I have a complex application that executes in a number of phases. I would like to profile only one of the phases.
The C++ application runs on Linux, x86-64.
This program takes several minutes to run. If I use perf to profile the whole thing, the resulting data set is too large for perf report to process. However, at this point I am interested only in profiling the execution of one phase of the program that takes maybe 1/3 of the total time. Perhaps this data set will be easier for perf to report on.
Ideally, I'd like something along the lines of "send yourself SIGUSR1 to start profiling, and SIGUSR2 to stop it". At that point I can easily delineate the execution phase that I want profile information for.
I can always write my own (albeit basic) profiler using SIGPROF, but is there a way I can do this with existing tools such as perf?