toolchain/share/doc/gprof.html/Primary.html

112 lines
4.5 KiB
HTML
Raw Normal View History

2024-01-10 05:24:32 +00:00
<html lang="en">
<head>
<title>Primary - 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="Call-Graph.html#Call-Graph" title="Call Graph">
<link rel="next" href="Callers.html#Callers" title="Callers">
<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-2019 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="Primary"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Callers.html#Callers">Callers</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Call-Graph.html#Call-Graph">Call Graph</a>
<hr>
</div>
<h4 class="subsection">5.2.1 The Primary Line</h4>
<p>The <dfn>primary line</dfn> in a call graph entry is the line that
describes the function which the entry is about and gives the overall
statistics for this function.
<p>For reference, we repeat the primary line from the entry for function
<code>report</code> in our main example, together with the heading line that
shows the names of the fields:
<pre class="smallexample"> index % time self children called name
...
[3] 100.0 0.00 0.05 1 report [3]
</pre>
<p>Here is what the fields in the primary line mean:
<dl>
<dt><code>index</code><dd>Entries are numbered with consecutive integers. Each function
therefore has an index number, which appears at the beginning of its
primary line.
<p>Each cross-reference to a function, as a caller or subroutine of
another, gives its index number as well as its name. The index number
guides you if you wish to look for the entry for that function.
<br><dt><code>% time</code><dd>This is the percentage of the total time that was spent in this
function, including time spent in subroutines called from this
function.
<p>The time spent in this function is counted again for the callers of
this function. Therefore, adding up these percentages is meaningless.
<br><dt><code>self</code><dd>This is the total amount of time spent in this function. This
should be identical to the number printed in the <code>seconds</code> field
for this function in the flat profile.
<br><dt><code>children</code><dd>This is the total amount of time spent in the subroutine calls made by
this function. This should be equal to the sum of all the <code>self</code>
and <code>children</code> entries of the children listed directly below this
function.
<br><dt><code>called</code><dd>This is the number of times the function was called.
<p>If the function called itself recursively, there are two numbers,
separated by a &lsquo;<samp><span class="samp">+</span></samp>&rsquo;. The first number counts non-recursive calls,
and the second counts recursive calls.
<p>In the example above, the function <code>report</code> was called once from
<code>main</code>.
<br><dt><code>name</code><dd>This is the name of the current function. The index number is
repeated after it.
<p>If the function is part of a cycle of recursion, the cycle number is
printed between the function's name and the index number
(see <a href="Cycles.html#Cycles">How Mutually Recursive Functions Are Described</a>).
For example, if function <code>gnurr</code> is part of
cycle number one, and has index number twelve, its primary line would
be end like this:
<pre class="example"> gnurr &lt;cycle 1&gt; [12]
</pre>
</dl>
</body></html>