Types of profiling

The QNX Application Profiler lets you perform:

  • Function Instrumentation profiling
  • Postmortem profiling for Call Count and Function Instrumentation profiling

Function Instrumentation profiling

This method provides you with precise function run time information for your project. It performs better on one thread, because with many threads, the overhead of such measurement can change the application's behavior.

To enable instrumentation, compile each source file with the option -finstrument-functions. This gcc option instructs the compiler to generate a call to the profiling function just after the entrance to, and just before the exit from every application function, which permits the collection of profiling information. Profiling functions are defined in the libprofilingS.a library; to access these, link the binary or library with the -lprofilingS option.

For an application that intends to use an instrumented library as a DLL (i.e. using a dlopen call), compile the library and the binary with the -Wl,-E linker option.

Postmortem profiling for Call Count and Function Instrumentation profiling

The IDE lets you examine profiling information from an output file produced by an instrumented application (i.e. gmon.out). The tool provides you with all of the information collected at runtime, but in a graphical format.

Postmortem profiling supports data generated by gprof (gmon.out), the QNX profiler library (.ptrace), and the trace logger (.kev).

For more information about the gprof utility, go to www.gnu.org, see the Utilities Reference.

Last modified: 2013-12-21

comments powered by Disqus