1GPROF(1) GNU GPROF(1)
2
3
4
6 gprof - display call graph profile data
7
9 gprof [ -[abcDhilLrsTvwxyz] ] [ -[ACeEfFJnNOpPqQZ][name] ]
10 [ -I dirs ] [ -d[num] ] [ -k from/to ]
11 [ -m min-count ] [ -R map_file ] [ -t table-length ]
12 [ --[no-]annotated-source[=name] ]
13 [ --[no-]exec-counts[=name] ]
14 [ --[no-]flat-profile[=name] ] [ --[no-]graph[=name] ]
15 [ --[no-]time=name] [ --all-lines ] [ --brief ]
16 [ --debug[=level] ] [ --function-ordering ]
17 [ --file-ordering map_file ] [ --directory-path=dirs ]
18 [ --display-unused-functions ] [ --file-format=name ]
19 [ --file-info ] [ --help ] [ --line ] [ --inline-file-names ]
20 [ --min-count=n ] [ --no-static ] [ --print-path ]
21 [ --separate-files ] [ --static-call-graph ] [ --sum ]
22 [ --table-length=len ] [ --traditional ] [ --version ]
23 [ --width=n ] [ --ignore-non-functions ]
24 [ --demangle[=STYLE] ] [ --no-demangle ]
25 [--external-symbol-table=name]
26 [ image-file ] [ profile-file ... ]
27
29 "gprof" produces an execution profile of C, Pascal, or Fortran77
30 programs. The effect of called routines is incorporated in the profile
31 of each caller. The profile data is taken from the call graph profile
32 file (gmon.out default) which is created by programs that are compiled
33 with the -pg option of "cc", "pc", and "f77". The -pg option also
34 links in versions of the library routines that are compiled for
35 profiling. "Gprof" reads the given object file (the default is
36 "a.out") and establishes the relation between its symbol table and the
37 call graph profile from gmon.out. If more than one profile file is
38 specified, the "gprof" output shows the sum of the profile information
39 in the given profile files.
40
41 "Gprof" calculates the amount of time spent in each routine. Next,
42 these times are propagated along the edges of the call graph. Cycles
43 are discovered, and calls into a cycle are made to share the time of
44 the cycle.
45
46 Several forms of output are available from the analysis.
47
48 The flat profile shows how much time your program spent in each
49 function, and how many times that function was called. If you simply
50 want to know which functions burn most of the cycles, it is stated
51 concisely here.
52
53 The call graph shows, for each function, which functions called it,
54 which other functions it called, and how many times. There is also an
55 estimate of how much time was spent in the subroutines of each
56 function. This can suggest places where you might try to eliminate
57 function calls that use a lot of time.
58
59 The annotated source listing is a copy of the program's source code,
60 labeled with the number of times each line of the program was executed.
61
63 These options specify which of several output formats "gprof" should
64 produce.
65
66 Many of these options take an optional symspec to s