Controlling profiling through signals

Updated: April 19, 2023

You can pause (temporarily stop) and resume (restart) profiling activity by sending POSIX signals to the process for a binary built with profiling instrumentation. Using signals lets you gather profiling data at specific times as an application runs.

Note: For this IPC mechanism to work, you must register signal handlers before launching the application. You can do this through the Control fields in the Application Profiler UI or by setting the QPROF_SIG_STOP_PROFILING and QPROF_SIG_CONT_PROFILING environment variables on the command line that launches the application.

In the IDE, you can send signals to target processes by using the Target Navigator. You must use whatever signals are defined in the Control fields; by default, these signals are 17 for pausing profiling and 16 for resuming it.

On the command line, you can use the kill command. Here, you must use the signals defined in the environment variables. Note that in either case, you can't change the signal mapping at runtime.