gprof
all
Performance analysis tool for many programming languages. It profiles the function executions of a program.
More info →Options (3)
-pbooleanCompile binary to default `a.out` with gprof information and run it to get `gmon.out`
Example:
gcc {{[-p|-pg]}} {{program.c}} && ./a.out-b, --briefbooleanSuppress profile field's description
Example:
gprof {{[-b|--brief]}}booleanDisplay routines that have zero usage
Example:
gprof {{[-bz|--brief --display-unused-functions]}}Examples (5)
Compile binary to default `a.out` with gprof information and run it to get `gmon.out`
gcc [-p|-pg] program.c && ./a.outRun gprof on default `a.out` and `gmon.out` to obtain profile output
Run gprof on a named binary
gprof path/to/binary path/to/gmon.outSuppress profile field's description
gprof [-b|--brief]Display routines that have zero usage
gprof [-bz|--brief --display-unused-functions]made by @shridhargupta | data from tldr-pages