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: Primary</title> 17 18<meta name="description" content="GNU gprof: Primary"> 19<meta name="keywords" content="GNU gprof: Primary"> 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="Call-Graph.html#Call-Graph" rel="up" title="Call Graph"> 27<link href="Callers.html#Callers" rel="next" title="Callers"> 28<link href="Call-Graph.html#Call-Graph" rel="previous" title="Call Graph"> 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="Primary"></a> 63<div class="header"> 64<p> 65Next: <a href="Callers.html#Callers" accesskey="n" rel="next">Callers</a>, Up: <a href="Call-Graph.html#Call-Graph" accesskey="u" rel="up">Call Graph</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> 66</div> 67<hr> 68<a name="The-Primary-Line"></a> 69<h4 class="subsection">5.2.1 The Primary Line</h4> 70 71<p>The <em>primary line</em> in a call graph entry is the line that 72describes the function which the entry is about and gives the overall 73statistics for this function. 74</p> 75<p>For reference, we repeat the primary line from the entry for function 76<code>report</code> in our main example, together with the heading line that 77shows the names of the fields: 78</p> 79<div class="smallexample"> 80<pre class="smallexample">index % time self children called name 81… 82[3] 100.0 0.00 0.05 1 report [3] 83</pre></div> 84 85<p>Here is what the fields in the primary line mean: 86</p> 87<dl compact="compact"> 88<dt><code>index</code></dt> 89<dd><p>Entries are numbered with consecutive integers. Each function 90therefore has an index number, which appears at the beginning of its 91primary line. 92</p> 93<p>Each cross-reference to a function, as a caller or subroutine of 94another, gives its index number as well as its name. The index number 95guides you if you wish to look for the entry for that function. 96</p> 97</dd> 98<dt><code>% time</code></dt> 99<dd><p>This is the percentage of the total time that was spent in this 100function, including time spent in subroutines called from this 101function. 102</p> 103<p>The time spent in this function is counted again for the callers of 104this function. Therefore, adding up these percentages is meaningless. 105</p> 106</dd> 107<dt><code>self</code></dt> 108<dd><p>This is the total amount of time spent in this function. This 109should be identical to the number printed in the <code>seconds</code> field 110for this function in the flat profile. 111</p> 112</dd> 113<dt><code>children</code></dt> 114<dd><p>This is the total amount of time spent in the subroutine calls made by 115this function. This should be equal to the sum of all the <code>self</code> 116and <code>children</code> entries of the children listed directly below this 117function. 118</p> 119</dd> 120<dt><code>called</code></dt> 121<dd><p>This is the number of times the function was called. 122</p> 123<p>If the function called itself recursively, there are two numbers, 124separated by a ‘<samp>+</samp>’. The first number counts non-recursive calls, 125and the second counts recursive calls. 126</p> 127<p>In the example above, the function <code>report</code> was called once from 128<code>main</code>. 129</p> 130</dd> 131<dt><code>name</code></dt> 132<dd><p>This is the name of the current function. The index number is 133repeated after it. 134</p> 135<p>If the function is part of a cycle of recursion, the cycle number is 136printed between the function’s name and the index number 137(see <a href="Cycles.html#Cycles">How Mutually Recursive Functions Are Described</a>). 138For example, if function <code>gnurr</code> is part of 139cycle number one, and has index number twelve, its primary line would 140be end like this: 141</p> 142<div class="example"> 143<pre class="example">gnurr <cycle 1> [12] 144</pre></div> 145</dd> 146</dl> 147 148<hr> 149<div class="header"> 150<p> 151Next: <a href="Callers.html#Callers" accesskey="n" rel="next">Callers</a>, Up: <a href="Call-Graph.html#Call-Graph" accesskey="u" rel="up">Call Graph</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p> 152</div> 153 154 155 156</body> 157</html> 158