1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-09 15:45:25 +02:00
tldr/pages/common/gprof.md
Managor a5833ce758
*: make more information links dynamic (#16244)
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
2025-04-23 10:24:12 +03:00

25 lines
668 B
Markdown

# gprof
> Performance analysis tool for many programming languages.
> It profiles the function executions of a program.
> More information: <https://ftp.gnu.org/old-gnu/Manuals/gprof/html_mono/gprof.html>.
- Compile binary to default `a.out` with gprof information and run it to get `gmon.out`:
`gcc {{[-p|-pg]}} {{program.c}} && ./a.out`
- Run gprof on default `a.out` and `gmon.out` to obtain profile output:
`gprof`
- Run gprof on a named binary:
`gprof {{path/to/binary}} {{path/to/gmon.out}}`
- Suppress profile field's description:
`gprof {{[-b|--brief]}}`
- Display routines that have zero usage:
`gprof {{[-bz|--brief --display-unused-functions]}}`