gprof: Analysis Options
1
1 4.2 Analysis Options
1 ====================
1
1 '-a'
1 '--no-static'
1 The '-a' option causes 'gprof' to suppress the printing of
1 statically declared (private) functions. (These are functions
1 whose names are not listed as global, and which are not visible
1 outside the file/function/block where they were defined.) Time
1 spent in these functions, calls to/from them, etc., will all be
1 attributed to the function that was loaded directly before it in
1 the executable file. This option affects both the flat profile and
1 the call graph.
1
1 '-c'
1 '--static-call-graph'
1 The '-c' option causes the call graph of the program to be
1 augmented by a heuristic which examines the text space of the
1 object file and identifies function calls in the binary machine
1 code. Since normal call graph records are only generated when
1 functions are entered, this option identifies children that could
1 have been called, but never were. Calls to functions that were not
1 compiled with profiling enabled are also identified, but only if
1 symbol table entries are present for them. Calls to dynamic
1 library routines are typically _not_ found by this option. Parents
1 or children identified via this heuristic are indicated in the call
1 graph with call counts of '0'.
1
1 '-D'
1 '--ignore-non-functions'
1 The '-D' option causes 'gprof' to ignore symbols which are not
1 known to be functions. This option will give more accurate profile
1 data on systems where it is supported (Solaris and HPUX for
1 example).
1
1 '-k FROM/TO'
1 The '-k' option allows you to delete from the call graph any arcs
1 from symbols matching symspec FROM to those matching symspec TO.
1
1 '-l'
1 '--line'
1 The '-l' option enables line-by-line profiling, which causes
1 histogram hits to be charged to individual source code lines,
1 instead of functions. This feature only works with programs
1 compiled by older versions of the 'gcc' compiler. Newer versions
1 of 'gcc' are designed to work with the 'gcov' tool instead.
1
1 If the program was compiled with basic-block counting enabled, this
1 option will also identify how many times each line of code was
1 executed. While line-by-line profiling can help isolate where in a
1 large function a program is spending its time, it also
1 significantly increases the running time of 'gprof', and magnifies
11 statistical inaccuracies. ⇒Statistical Sampling Error
Sampling Error.
1
1 '--inline-file-names'
1 This option causes 'gprof' to print the source file after each
1 symbol in both the flat profile and the call graph. The full path
1 to the file is printed if used with the '-L' option.
1
1 '-m NUM'
1 '--min-count=NUM'
1 This option affects execution count output only. Symbols that are
1 executed less than NUM times are suppressed.
1
1 '-nSYMSPEC'
1 '--time=SYMSPEC'
1 The '-n' option causes 'gprof', in its call graph analysis, to only
1 propagate times for symbols matching SYMSPEC.
1
1 '-NSYMSPEC'
1 '--no-time=SYMSPEC'
1 The '-n' option causes 'gprof', in its call graph analysis, not to
1 propagate times for symbols matching SYMSPEC.
1
1 '-SFILENAME'
1 '--external-symbol-table=FILENAME'
1 The '-S' option causes 'gprof' to read an external symbol table
1 file, such as '/proc/kallsyms', rather than read the symbol table
1 from the given object file (the default is 'a.out'). This is
1 useful for profiling kernel modules.
1
1 '-z'
1 '--display-unused-functions'
1 If you give the '-z' option, 'gprof' will mention all functions in
1 the flat profile, even those that were never called, and that had
1 no time spent in them. This is useful in conjunction with the '-c'
1 option for discovering which routines were never called.
1