Name

gprof

Synopsis

gprof [options] [object_file]

Display the profile data for an object file. The file’s symbol table is compared with the call graph profile file gmon.out (previously created by compiling with gcc -pg). Many of gprof’s options take a symbol-specification argument, or symspec, to limit the option to specified files or functions. The symspec may be a filename, a function, or a line number. It can also be given as filename:function or filename:linenumber to specify a function or line number in a specific file. gprof expects filenames to contain a period and functions to not contain a period.

Options

-a, --no-static

Do not display statically declared functions. Since their information might still be relevant, append it to the information about the functions loaded immediately before.

-b, --brief

Do not display information about each field in the profile.

-c, --static-call-graph

Consult the object file’s text area to attempt to determine the program’s static call graph. Display static-only parents and children with call counts of 0.

--demangle[=style], --no-demangle

Specify whether C++ symbols should be demangled or not. They are demangled by default. If profiling a program built by a different compiler, you may need to specify the mangling style.

--function-ordering

Print suggested function order based on profiling data.

--file-ordering file

Print suggested link line order for .o files based on profiling data. Read function name to object file mappings from file. This file can be ...

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.