UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: gettxtChapter 2
Unix Commands
Next: Reference: grep
 

gprof

/usr/ccs/bin/gprof [options] [objfile [pfile]]

Solaris only. (Many other modern Unix systems also have it.) Display call-graph profile data of C programs. Programs compiled with the -xpg option of cc (-pg on other compilers) produce a call-graph profile file pfile, whose default name is gmon.out. The specified object file objfile (a.out by default) contains a symbol table that is read and correlated with pfile. See also prof and lprof.

Options

-a

Don't print statically declared functions.

-b

Brief; don't print field descriptions in the profile.

-c

Find the program's static call-graph. Call counts of 0 indicate static-only parents or children.

-C

Demangle C++ symbol names before printing them out.

-D

With this option, you supply one or more existing pfiles. Process the information in all specified profile files and produce profile file called gmon.sum that shows the difference between the runs. See also the -s option below.

-e name

Don't print the graph profile entry for the routine name. -e may be repeated.

-E name

Like -e above. In addition, during time computations, omit the time spent in name.

-f name

Print the graph profile entry only for routine name. -f may be repeated.

-F name

Like -f above. In addition, during time computations, use only the times of the printed routines. -F may be repeated, and it overrides -E.

-l

Don't print entries for local symbols.

-s

With this option, you supply one or more existing pfiles. Sum the information in all specified profile files and send it to a profile file called gmon.sum. Useful for accumulating data across several runs.

-z

Show routines that have zero usage. Useful with -c to find out which routines were never called.

-n

Only print the top n functions.


Previous: Reference: gettxtUNIX in a Nutshell: System V EditionNext: Reference: grep
Reference: gettxtBook IndexReference: grep

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System