To run an instrumented binary with profiling from the command prompt:
-
To start the Application Profiler immediately after the application starts, set environment variable QPROF_AUTO_START:
QPROF_AUTO_START=1
-
To redirect the gmon output to a file, set the environment variable: QPROF_FILE
QPROF_FILE=/tmp/myapp.ptrace
-
To change to kernel trace logging, set the environment variable QPROF_KERNEL_TRACE=1:
-
To include the shared library path used for profiling, set the environment variable LD_LIBRARY_PATH:
LD_LIBRARY_PATH=.../profiling_lib:$LD_LIBRARY_PATH
-
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