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: Subroutines</title> 17 18<meta name="description" content="GNU gprof: Subroutines"> 19<meta name="keywords" content="GNU gprof: Subroutines"> 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="Cycles.html#Cycles" rel="next" title="Cycles"> 28<link href="Callers.html#Callers" rel="previous" title="Callers"> 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="Subroutines"></a> 63<div class="header"> 64<p> 65Next: <a href="Cycles.html#Cycles" accesskey="n" rel="next">Cycles</a>, Previous: <a href="Callers.html#Callers" accesskey="p" rel="previous">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="Lines-for-a-Function_0027s-Subroutines"></a> 69<h4 class="subsection">5.2.3 Lines for a Function’s Subroutines</h4> 70 71<p>A function’s entry has a line for each of its subroutines—in other 72words, a line for each other function that it called. These lines’ 73fields correspond to the fields of the primary line, but their meanings 74are different because of the difference in context. 75</p> 76<p>For reference, we repeat two lines from the entry for the function 77<code>main</code>, the primary line and a line for a subroutine, together 78with the heading line that shows the names of the fields: 79</p> 80<div class="smallexample"> 81<pre class="smallexample">index % time self children called name 82… 83[2] 100.0 0.00 0.05 1 main [2] 84 0.00 0.05 1/1 report [3] 85</pre></div> 86 87<p>Here are the meanings of the fields in the subroutine-line for <code>main</code> 88calling <code>report</code>: 89</p> 90<dl compact="compact"> 91<dt><code>self</code></dt> 92<dd><p>An estimate of the amount of time spent directly within <code>report</code> 93when <code>report</code> was called from <code>main</code>. 94</p> 95</dd> 96<dt><code>children</code></dt> 97<dd><p>An estimate of the amount of time spent in subroutines of <code>report</code> 98when <code>report</code> was called from <code>main</code>. 99</p> 100<p>The sum of the <code>self</code> and <code>children</code> fields is an estimate 101of the total time spent in calls to <code>report</code> from <code>main</code>. 102</p> 103</dd> 104<dt><code>called</code></dt> 105<dd><p>Two numbers, the number of calls to <code>report</code> from <code>main</code> 106followed by the total number of non-recursive calls to <code>report</code>. 107This ratio is used to determine how much of <code>report</code>’s <code>self</code> 108and <code>children</code> time gets credited to <code>main</code>. 109See <a href="Assumptions.html#Assumptions">Estimating <code>children</code> Times</a>. 110</p> 111</dd> 112<dt><code>name</code></dt> 113<dd><p>The name of the subroutine of <code>main</code> to which this line applies, 114followed by the subroutine’s index number. 115</p> 116<p>If the caller is part of a recursion cycle, the cycle number is 117printed between the name and the index number. 118</p></dd> 119</dl> 120 121<hr> 122<div class="header"> 123<p> 124Next: <a href="Cycles.html#Cycles" accesskey="n" rel="next">Cycles</a>, Previous: <a href="Callers.html#Callers" accesskey="p" rel="previous">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> 125</div> 126 127 128 129</body> 130</html> 131