Use Sampling and Call Count instrumentation mode

Sampling mode provides you with profiling information for your project at a specific time interval (the Application Profiler takes samples from processes at given rate). The information is recorded into a sample that you can use for comparison purposes.

Note:

When you use sampling mode to obtain only data, you'll notice the following:

Launching from the IDE

To prepare your binary for Call Count instrumentation:

  1. Optional: Depending on your type of project, do one of the following to prepare your binary:
    • For a QNX C/C++ project:
      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 Instrumentation).

    • For a managed project:
      1. Right-click on a project and select Properties.
      2. From the menu, select C/C++ Build > Settings > Tools settings.
      3. From the list on the right for your compiler (i.e. QCC Compiler), select an item from the list and select Output Control.
      4. Select the Enable call count profiling (-p) option.
      5. From the list on the right for your linker (i.e. QCC Linker), select an item from the list, then select Output Control.
      6. Select the Build for Profiling (Call Count) (-p) option.
    • For a Makefile:

      To build a C/C++ project for profiling, compile and link using the -p option. For example, your Makefile might have a line like this:

      CFLAGS=-p CXXFLAGS=-p LDFLAGS=-p 
  2. Create a launch configuration for your application, add click the Tools tab.
  3. Select Application Profiler and click OK.
  4. From the Application Profiler tab, select Sampling and Call Count Instrumentation.
  5. Select the Single Application option.
  6. Select the Switch to this tool's perspective on launch checkbox.
  7. Run the configuration to begin the profiling process.

Now, your application is launched, as well as the Application Profiler tool. The Application Profiler perspective opens and the Execution Time view shows data from the current session; the view is automatically refreshed.

To customize your Execution Time view if you're running in this mode:

  1. In the Execution Time view, select Tools > Preferences from the menu.
  2. Deselect the following columns because they aren't applicable:
    • Deep Time
    • Average
    • Max
    • Min
  3. Deselect the option Show percent in the Name column.
  4. Deselect the option Show own time as a node.
  5. Click OK.
  6. Click the Show Table button. This is the recommended mode to start the Sampling and Call Count mode.
  7. Click the Shallow Time column to sort by time.