1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 21:22:09 +02:00
tldr/pages/common/gprof.md
jxu c11d66458a
gprof: add instructions for named binary (#15505)
* gprof: Add instructions for named binary

Resolves #15500

* gprof: fix whitespace

* gprof: add paths to inputs

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>

* gprof: do not use placeholder for a.out

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>

---------

Co-authored-by: Florian B. <gn0mish@protonmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Juri Dispan <juri.dispan@posteo.net>
2025-01-20 15:53:45 -05:00

610 B

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-2.9.1/html_mono/gprof.html.

  • Compile binary to default a.out with gprof information and run it to get gmon.out:

gcc -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

  • Display routines that have zero usage:

gprof -bz