Run an instrumented binary with profiling from a command prompt (Function Instrumentation mode)

To run an instrumented binary with profiling from the command prompt:
  1. To start the Application Profiler immediately after the application starts, set environment variable QPROF_AUTO_START:
  2. To redirect the gmon output to a file, set the environment variable: QPROF_FILE
  3. To change to kernel trace logging, set the environment variable QPROF_KERNEL_TRACE=1:
  4. To include the shared library path used for profiling, set the environment variable LD_LIBRARY_PATH:
  5. To run the application, set the following:
    QPROF_AUTO_START=1 QPROF_FILE=/tmp/myapp.ptrace \
    LD_LIBRARY_PATH=.../profiling_lib:$LD_LIBRARY_PATH ./myapp