Use postmortem profiling for Call Count and Sampling

You can change the configuration options to profile an application to capture performance information whereby profiling is done by code linked into the process, and after the process exits normally (without error). Data, which is the function information (such as call counts, callers, and statistics), is written to a file that you can then load into the IDE.
To configure postmortem profiling:
  1. In the Project Explorer view, right-click your project and select Properties.
  2. In the left pane, select QNX C/C++ project.
  3. In the right pane, select the Options tab.
  4. Select Build for Profiling (Call Count).
  5. Select the Build Variants tab and select the Debug variant for your target(s).
  6. Click OK.
  7. When prompted, click Yes to rebuild your project.
  8. Create a launch configuration for a debuggable executable.
  9. Select the Environment tab. Profiling information is written to a file in the location you specify with the PROFDIR environment variable. If you don't set PROFDIR, the information is written to a file called gmon.out in the directory the process was run from.
  10. In the Name field, type PROFDIR.
  11. In the Value field. Type a valid path to a directory on your target machine, (i.e. /tmp).
  12. Click OK.
  13. Run the program.
  14. When the execution finishes, import a data file, such as gmon.out, by doing the following:
    1. Select Window > Show View > Other > QNX Targets > Target File System Navigator.
    2. In the Select target folder dialog, select the project related to your program.
    3. Click OK.
  15. In the Project Explorer view, right-click the imported file and rename it, i.e. to gmon.out.
  16. To start a postmortem profiling session, do the following:
    1. In the Project Explorer view, right-click on the file gmon.out and select the Import/Open action in the QNX Application Profiler.
    2. In the Import from gmon.out file window, browse to set the location of the executable file.
    3. Click Finish.
Now, you can begin to analyze the profiler data.