1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- This file documents the gprof profiler of the GNU system.
4
5Copyright (C) 1988-2021 Free Software Foundation, Inc.
6
7Permission is granted to copy, distribute and/or modify this document
8under the terms of the GNU Free Documentation License, Version 1.3
9or any later version published by the Free Software Foundation;
10with no Invariant Sections, with no Front-Cover Texts, and with no
11Back-Cover Texts.  A copy of the license is included in the
12section entitled "GNU Free Documentation License".
13 -->
14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
15<head>
16<title>GNU gprof: Analysis Options</title>
17
18<meta name="description" content="GNU gprof: Analysis Options">
19<meta name="keywords" content="GNU gprof: Analysis Options">
20<meta name="resource-type" content="document">
21<meta name="distribution" content="global">
22<meta name="Generator" content="makeinfo">
23<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
24<link href="index.html#Top" rel="start" title="Top">
25<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
26<link href="Invoking.html#Invoking" rel="up" title="Invoking">
27<link href="Miscellaneous-Options.html#Miscellaneous-Options" rel="next" title="Miscellaneous Options">
28<link href="Output-Options.html#Output-Options" rel="previous" title="Output Options">
29<style type="text/css">
30<!--
31a.summary-letter {text-decoration: none}
32blockquote.smallquotation {font-size: smaller}
33div.display {margin-left: 3.2em}
34div.example {margin-left: 3.2em}
35div.indentedblock {margin-left: 3.2em}
36div.lisp {margin-left: 3.2em}
37div.smalldisplay {margin-left: 3.2em}
38div.smallexample {margin-left: 3.2em}
39div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
40div.smalllisp {margin-left: 3.2em}
41kbd {font-style:oblique}
42pre.display {font-family: inherit}
43pre.format {font-family: inherit}
44pre.menu-comment {font-family: serif}
45pre.menu-preformatted {font-family: serif}
46pre.smalldisplay {font-family: inherit; font-size: smaller}
47pre.smallexample {font-size: smaller}
48pre.smallformat {font-family: inherit; font-size: smaller}
49pre.smalllisp {font-size: smaller}
50span.nocodebreak {white-space:nowrap}
51span.nolinebreak {white-space:nowrap}
52span.roman {font-family:serif; font-weight:normal}
53span.sansserif {font-family:sans-serif; font-weight:normal}
54ul.no-bullet {list-style: none}
55-->
56</style>
57
58
59</head>
60
61<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
62<a name="Analysis-Options"></a>
63<div class="header">
64<p>
65Next: <a href="Miscellaneous-Options.html#Miscellaneous-Options" accesskey="n" rel="next">Miscellaneous Options</a>, Previous: <a href="Output-Options.html#Output-Options" accesskey="p" rel="previous">Output Options</a>, Up: <a href="Invoking.html#Invoking" accesskey="u" rel="up">Invoking</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
66</div>
67<hr>
68<a name="Analysis-Options-1"></a>
69<h3 class="section">4.2 Analysis Options</h3>
70
71<dl compact="compact">
72<dt><code>-a</code></dt>
73<dt><code>--no-static</code></dt>
74<dd><p>The &lsquo;<samp>-a</samp>&rsquo; option causes <code>gprof</code> to suppress the printing of
75statically declared (private) functions.  (These are functions whose
76names are not listed as global, and which are not visible outside the
77file/function/block where they were defined.)  Time spent in these
78functions, calls to/from them, etc., will all be attributed to the
79function that was loaded directly before it in the executable file.
80This option affects both the flat profile and the call graph.
81</p>
82</dd>
83<dt><code>-c</code></dt>
84<dt><code>--static-call-graph</code></dt>
85<dd><p>The &lsquo;<samp>-c</samp>&rsquo; option causes the call graph of the program to be
86augmented by a heuristic which examines the text space of the object
87file and identifies function calls in the binary machine code.
88Since normal call graph records are only generated when functions are
89entered, this option identifies children that could have been called,
90but never were.  Calls to functions that were not compiled with
91profiling enabled are also identified, but only if symbol table
92entries are present for them.
93Calls to dynamic library routines are typically <em>not</em> found
94by this option.
95Parents or children identified via this heuristic
96are indicated in the call graph with call counts of &lsquo;<samp>0</samp>&rsquo;.
97</p>
98</dd>
99<dt><code>-D</code></dt>
100<dt><code>--ignore-non-functions</code></dt>
101<dd><p>The &lsquo;<samp>-D</samp>&rsquo; option causes <code>gprof</code> to ignore symbols which
102are not known to be functions.  This option will give more accurate
103profile data on systems where it is supported (Solaris and HPUX for
104example).
105</p>
106</dd>
107<dt><code>-k <var>from</var>/<var>to</var></code></dt>
108<dd><p>The &lsquo;<samp>-k</samp>&rsquo; option allows you to delete from the call graph any arcs from
109symbols matching symspec <var>from</var> to those matching symspec <var>to</var>.
110</p>
111</dd>
112<dt><code>-l</code></dt>
113<dt><code>--line</code></dt>
114<dd><p>The &lsquo;<samp>-l</samp>&rsquo; option enables line-by-line profiling, which causes
115histogram hits to be charged to individual source code lines,
116instead of functions.  This feature only works with programs compiled
117by older versions of the <code>gcc</code> compiler.  Newer versions of
118<code>gcc</code> are designed to work with the <code>gcov</code> tool instead.
119</p>
120<p>If the program was compiled with basic-block counting enabled,
121this option will also identify how many times each line of
122code was executed.
123While line-by-line profiling can help isolate where in a large function
124a program is spending its time, it also significantly increases
125the running time of <code>gprof</code>, and magnifies statistical
126inaccuracies.
127See <a href="Sampling-Error.html#Sampling-Error">Statistical Sampling Error</a>.
128</p>
129</dd>
130<dt><code>--inline-file-names</code></dt>
131<dd><p>This option causes <code>gprof</code> to print the source file after each
132symbol in both the flat profile and the call graph. The full path to the
133file is printed if used with the &lsquo;<samp>-L</samp>&rsquo; option.
134</p>
135</dd>
136<dt><code>-m <var>num</var></code></dt>
137<dt><code>--min-count=<var>num</var></code></dt>
138<dd><p>This option affects execution count output only.
139Symbols that are executed less than <var>num</var> times are suppressed.
140</p>
141</dd>
142<dt><code>-n<var>symspec</var></code></dt>
143<dt><code>--time=<var>symspec</var></code></dt>
144<dd><p>The &lsquo;<samp>-n</samp>&rsquo; option causes <code>gprof</code>, in its call graph analysis,
145to only propagate times for symbols matching <var>symspec</var>.
146</p>
147</dd>
148<dt><code>-N<var>symspec</var></code></dt>
149<dt><code>--no-time=<var>symspec</var></code></dt>
150<dd><p>The &lsquo;<samp>-n</samp>&rsquo; option causes <code>gprof</code>, in its call graph analysis,
151not to propagate times for symbols matching <var>symspec</var>.
152</p>
153</dd>
154<dt><code>-S<var>filename</var></code></dt>
155<dt><code>--external-symbol-table=<var>filename</var></code></dt>
156<dd><p>The &lsquo;<samp>-S</samp>&rsquo; option causes <code>gprof</code> to read an external symbol table
157file, such as <samp>/proc/kallsyms</samp>, rather than read the symbol table
158from the given object file (the default is <code>a.out</code>). This is useful
159for profiling kernel modules.
160</p>
161</dd>
162<dt><code>-z</code></dt>
163<dt><code>--display-unused-functions</code></dt>
164<dd><p>If you give the &lsquo;<samp>-z</samp>&rsquo; option, <code>gprof</code> will mention all
165functions in the flat profile, even those that were never called, and
166that had no time spent in them.  This is useful in conjunction with the
167&lsquo;<samp>-c</samp>&rsquo; option for discovering which routines were never called.
168</p>
169</dd>
170</dl>
171
172<hr>
173<div class="header">
174<p>
175Next: <a href="Miscellaneous-Options.html#Miscellaneous-Options" accesskey="n" rel="next">Miscellaneous Options</a>, Previous: <a href="Output-Options.html#Output-Options" accesskey="p" rel="previous">Output Options</a>, Up: <a href="Invoking.html#Invoking" accesskey="u" rel="up">Invoking</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
176</div>
177
178
179
180</body>
181</html>
182