Profile a running process

You can run a process on the target (without the IDE) and collect the profiling information while it's running. In order to collect profiling information, you have to modify the way you normally launch your application by adding environment variables:

Note: If you're launching using the IDE, you can specify the environment variables on the Environment tab in the launch configuration.
Note: When you profile a running process, you can't use the Console view in the IDE to interact with this process. If your running process requires user input through the Console view, use a shell to interact with the process.
To profile a process that's already running on your target:
  1. While the application is running, open the Launch Configurations dialog by choosing Run > Profile from the menu.
  2. Select C/C++ QNX Attach to Remote Process via QConn (IP) from the list on the left.
  3. Click the New button to create a new attach-to-process configuration.
  4. Configure things as you normally would for launching the application with debugging.
  5. On the Tools tab, click Add/Delete Tool…. The Tools Selection dialog is displayed.
  6. Select the Application Profiler tool, then click OK. On the launcher, the Application Profiler tab is displayed.

    For descriptions about the options, see Application Profiler tab.

  7. If you're using Function Instrumentation, make sure that the value in the Path on target for profiler trace field matches the value of QPROF_FILE that you used to run the application.
  8. Select Switch to this tool's perspective on launch.
  9. Optional: In the launcher, click the Shared Libraries tab.
    The IDE doesn't know the location of your shared library paths, so you must specify the directory containing any libraries that you wish to profile.
  10. Click Apply, and then click Run. The Select Process dialog shows all of the currently running processes:

  11. Select the process you want to profile, and then click OK.