mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-21 02:02:02 +00:00
Update cheatsheets
This commit is contained in:
10
tldr/gprof
10
tldr/gprof
@@ -9,14 +9,18 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> 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 with gprof information and run it to get `gmon.out`:
|
||||
- Compile binary to default `a.out` with gprof information and run it to get `gmon.out`:
|
||||
|
||||
`gcc -pg {{program.c}} && {{./a.out}}`
|
||||
`gcc -pg {{program.c}} && ./a.out`
|
||||
|
||||
- Run gprof to obtain profile output:
|
||||
- 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`
|
||||
|
||||
Reference in New Issue
Block a user