You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
123 lines
7.0 KiB
HTML
123 lines
7.0 KiB
HTML
<html lang="en">
|
|
<head>
|
|
<title>Analysis Options - GNU gprof</title>
|
|
<meta http-equiv="Content-Type" content="text/html">
|
|
<meta name="description" content="GNU gprof">
|
|
<meta name="generator" content="makeinfo 4.13">
|
|
<link title="Top" rel="start" href="index.html#Top">
|
|
<link rel="up" href="Invoking.html#Invoking" title="Invoking">
|
|
<link rel="prev" href="Output-Options.html#Output-Options" title="Output Options">
|
|
<link rel="next" href="Miscellaneous-Options.html#Miscellaneous-Options" title="Miscellaneous Options">
|
|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
|
<!--
|
|
This file documents the gprof profiler of the GNU system.
|
|
|
|
Copyright (C) 1988-2015 Free Software Foundation, Inc.
|
|
|
|
Permission is granted to copy, distribute and/or modify this document
|
|
under the terms of the GNU Free Documentation License, Version 1.3
|
|
or any later version published by the Free Software Foundation;
|
|
with no Invariant Sections, with no Front-Cover Texts, and with no
|
|
Back-Cover Texts. A copy of the license is included in the
|
|
section entitled ``GNU Free Documentation License''.
|
|
|
|
-->
|
|
<meta http-equiv="Content-Style-Type" content="text/css">
|
|
<style type="text/css"><!--
|
|
pre.display { font-family:inherit }
|
|
pre.format { font-family:inherit }
|
|
pre.smalldisplay { font-family:inherit; font-size:smaller }
|
|
pre.smallformat { font-family:inherit; font-size:smaller }
|
|
pre.smallexample { font-size:smaller }
|
|
pre.smalllisp { font-size:smaller }
|
|
span.sc { font-variant:small-caps }
|
|
span.roman { font-family:serif; font-weight:normal; }
|
|
span.sansserif { font-family:sans-serif; font-weight:normal; }
|
|
--></style>
|
|
</head>
|
|
<body>
|
|
<div class="node">
|
|
<a name="Analysis-Options"></a>
|
|
<p>
|
|
Next: <a rel="next" accesskey="n" href="Miscellaneous-Options.html#Miscellaneous-Options">Miscellaneous Options</a>,
|
|
Previous: <a rel="previous" accesskey="p" href="Output-Options.html#Output-Options">Output Options</a>,
|
|
Up: <a rel="up" accesskey="u" href="Invoking.html#Invoking">Invoking</a>
|
|
<hr>
|
|
</div>
|
|
|
|
<h3 class="section">4.2 Analysis Options</h3>
|
|
|
|
<dl>
|
|
<dt><code>-a</code><dt><code>--no-static</code><dd>The ‘<samp><span class="samp">-a</span></samp>’ option causes <code>gprof</code> to suppress the printing of
|
|
statically declared (private) functions. (These are functions whose
|
|
names are not listed as global, and which are not visible outside the
|
|
file/function/block where they were defined.) Time spent in these
|
|
functions, calls to/from them, etc., will all be attributed to the
|
|
function that was loaded directly before it in the executable file.
|
|
<!-- This is compatible with Unix @code{gprof}, but a bad idea. -->
|
|
This option affects both the flat profile and the call graph.
|
|
|
|
<br><dt><code>-c</code><dt><code>--static-call-graph</code><dd>The ‘<samp><span class="samp">-c</span></samp>’ option causes the call graph of the program to be
|
|
augmented by a heuristic which examines the text space of the object
|
|
file and identifies function calls in the binary machine code.
|
|
Since normal call graph records are only generated when functions are
|
|
entered, this option identifies children that could have been called,
|
|
but never were. Calls to functions that were not compiled with
|
|
profiling enabled are also identified, but only if symbol table
|
|
entries are present for them.
|
|
Calls to dynamic library routines are typically <em>not</em> found
|
|
by this option.
|
|
Parents or children identified via this heuristic
|
|
are indicated in the call graph with call counts of ‘<samp><span class="samp">0</span></samp>’.
|
|
|
|
<br><dt><code>-D</code><dt><code>--ignore-non-functions</code><dd>The ‘<samp><span class="samp">-D</span></samp>’ option causes <code>gprof</code> to ignore symbols which
|
|
are not known to be functions. This option will give more accurate
|
|
profile data on systems where it is supported (Solaris and HPUX for
|
|
example).
|
|
|
|
<br><dt><code>-k </code><var>from</var><code>/</code><var>to</var><dd>The ‘<samp><span class="samp">-k</span></samp>’ option allows you to delete from the call graph any arcs from
|
|
symbols matching symspec <var>from</var> to those matching symspec <var>to</var>.
|
|
|
|
<br><dt><code>-l</code><dt><code>--line</code><dd>The ‘<samp><span class="samp">-l</span></samp>’ option enables line-by-line profiling, which causes
|
|
histogram hits to be charged to individual source code lines,
|
|
instead of functions. This feature only works with programs compiled
|
|
by older versions of the <code>gcc</code> compiler. Newer versions of
|
|
<code>gcc</code> are designed to work with the <code>gcov</code> tool instead.
|
|
|
|
<p>If the program was compiled with basic-block counting enabled,
|
|
this option will also identify how many times each line of
|
|
code was executed.
|
|
While line-by-line profiling can help isolate where in a large function
|
|
a program is spending its time, it also significantly increases
|
|
the running time of <code>gprof</code>, and magnifies statistical
|
|
inaccuracies.
|
|
See <a href="Sampling-Error.html#Sampling-Error">Statistical Sampling Error</a>.
|
|
|
|
<br><dt><code>--inline-file-names</code><dd>This option causes <code>gprof</code> to print the source file after each
|
|
symbol in both the flat profile and the call graph. The full path to the
|
|
file is printed if used with the ‘<samp><span class="samp">-L</span></samp>’ option.
|
|
|
|
<br><dt><code>-m </code><var>num</var><dt><code>--min-count=</code><var>num</var><dd>This option affects execution count output only.
|
|
Symbols that are executed less than <var>num</var> times are suppressed.
|
|
|
|
<br><dt><code>-n</code><var>symspec</var><dt><code>--time=</code><var>symspec</var><dd>The ‘<samp><span class="samp">-n</span></samp>’ option causes <code>gprof</code>, in its call graph analysis,
|
|
to only propagate times for symbols matching <var>symspec</var>.
|
|
|
|
<br><dt><code>-N</code><var>symspec</var><dt><code>--no-time=</code><var>symspec</var><dd>The ‘<samp><span class="samp">-n</span></samp>’ option causes <code>gprof</code>, in its call graph analysis,
|
|
not to propagate times for symbols matching <var>symspec</var>.
|
|
|
|
<br><dt><code>-S</code><var>filename</var><dt><code>--external-symbol-table=</code><var>filename</var><dd>The ‘<samp><span class="samp">-S</span></samp>’ option causes <code>gprof</code> to read an external symbol table
|
|
file, such as <samp><span class="file">/proc/kallsyms</span></samp>, rather than read the symbol table
|
|
from the given object file (the default is <code>a.out</code>). This is useful
|
|
for profiling kernel modules.
|
|
|
|
<br><dt><code>-z</code><dt><code>--display-unused-functions</code><dd>If you give the ‘<samp><span class="samp">-z</span></samp>’ option, <code>gprof</code> will mention all
|
|
functions in the flat profile, even those that were never called, and
|
|
that had no time spent in them. This is useful in conjunction with the
|
|
‘<samp><span class="samp">-c</span></samp>’ option for discovering which routines were never called.
|
|
|
|
</dl>
|
|
|
|
</body></html>
|
|
|