Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   gprof    ( 1 )

отображать данные профиля графика звонков (display call graph profile data)

Имя (Name)

gprof - display call graph profile data


Синопсис (Synopsis)

gprof [ -[abcDhilLrsTvwxyz] ] [ -[ACeEfFJnNOpPqQRStZ][name] ] [ -I dirs ] [ -d[num] ] [ -k from/to ] [ -m min-count ] [ -R map_file ] [ -t table-length ] [ --[no-]annotated-source[=name] ] [ --[no-]exec-counts[=name] ] [ --[no-]flat-profile[=name] ] [ --[no-]graph[=name] ] [ --[no-]time=name] [ --all-lines ] [ --brief ] [ --debug[=level] ] [ --function-ordering ] [ --file-ordering map_file ] [ --directory-path=dirs ] [ --display-unused-functions ] [ --file-format=name ] [ --file-info ] [ --help ] [ --line ] [ --inline-file-names ] [ --min-count=n ] [ --no-static ] [ --print-path ] [ --separate-files ] [ --static-call-graph ] [ --sum ] [ --table-length=len ] [ --traditional ] [ --version ] [ --width=n ] [ --ignore-non-functions ] [ --demangle[=STYLE] ] [ --no-demangle ] [--external-symbol-table=name] [ image-file ] [ profile-file ... ]


Описание (Description)

"gprof" produces an execution profile of C, Pascal, or Fortran77 programs. The effect of called routines is incorporated in the profile of each caller. The profile data is taken from the call graph profile file (gmon.out default) which is created by programs that are compiled with the -pg option of "cc", "pc", and "f77". The -pg option also links in versions of the library routines that are compiled for profiling. "Gprof" reads the given object file (the default is "a.out") and establishes the relation between its symbol table and the call graph profile from gmon.out. If more than one profile file is specified, the "gprof" output shows the sum of the profile information in the given profile files.

"Gprof" calculates the amount of time spent in each routine. Next, these times are propagated along the edges of the call graph. Cycles are discovered, and calls into a cycle are made to share the time of the cycle.

Several forms of output are available from the analysis.

The flat profile shows how much time your program spent in each function, and how many times that function was called. If you simply want to know which functions burn most of the cycles, it is stated concisely here.

The call graph shows, for each function, which functions called it, which other functions it called, and how many times. There is also an estimate of how much time was spent in the subroutines of each function. This can suggest places where you might try to eliminate function calls that use a lot of time.

The annotated source listing is a copy of the program's source code, labeled with the number of times each line of the program was executed.