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: Callers</title> 17 18<meta name="description" content="GNU gprof: Callers"> 19<meta name="keywords" content="GNU gprof: Callers"> 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="Subroutines.html#Subroutines" rel="next" title="Subroutines"> 28<link href="Primary.html#Primary" rel="previous" title="Primary"> 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="Callers"></a> 63<div class="header"> 64<p> 65Next: <a href="Subroutines.html#Subroutines" accesskey="n" rel="next">Subroutines</a>, Previous: <a href="Primary.html#Primary" accesskey="p" rel="previous">Primary</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-Callers"></a> 69<h4 class="subsection">5.2.2 Lines for a Function’s Callers</h4> 70 71<p>A function’s entry has a line for each function it was called by. 72These lines’ fields correspond to the fields of the primary line, but 73their meanings are different because of the difference in context. 74</p> 75<p>For reference, we repeat two lines from the entry for the function 76<code>report</code>, the primary line and one caller-line preceding it, together 77with the heading line that shows the names of the fields: 78</p> 79<div class="smallexample"> 80<pre class="smallexample">index % time self children called name 81… 82 0.00 0.05 1/1 main [2] 83[3] 100.0 0.00 0.05 1 report [3] 84</pre></div> 85 86<p>Here are the meanings of the fields in the caller-line for <code>report</code> 87called from <code>main</code>: 88</p> 89<dl compact="compact"> 90<dt><code>self</code></dt> 91<dd><p>An estimate of the amount of time spent in <code>report</code> itself when it was 92called from <code>main</code>. 93</p> 94</dd> 95<dt><code>children</code></dt> 96<dd><p>An estimate of the amount of time spent in subroutines of <code>report</code> 97when <code>report</code> was called from <code>main</code>. 98</p> 99<p>The sum of the <code>self</code> and <code>children</code> fields is an estimate 100of the amount of time spent within calls to <code>report</code> from <code>main</code>. 101</p> 102</dd> 103<dt><code>called</code></dt> 104<dd><p>Two numbers: the number of times <code>report</code> was called from <code>main</code>, 105followed by the total number of non-recursive calls to <code>report</code> from 106all its callers. 107</p> 108</dd> 109<dt><code>name and index number</code></dt> 110<dd><p>The name of the caller of <code>report</code> to which this line applies, 111followed by the caller’s index number. 112</p> 113<p>Not all functions have entries in the call graph; some 114options to <code>gprof</code> request the omission of certain functions. 115When a caller has no entry of its own, it still has caller-lines 116in the entries of the functions it calls. 117</p> 118<p>If the caller is part of a recursion cycle, the cycle number is 119printed between the name and the index number. 120</p></dd> 121</dl> 122 123<p>If the identity of the callers of a function cannot be determined, a 124dummy caller-line is printed which has ‘<samp><spontaneous></samp>’ as the 125“caller’s name” and all other fields blank. This can happen for 126signal handlers. 127</p> 128<hr> 129<div class="header"> 130<p> 131Next: <a href="Subroutines.html#Subroutines" accesskey="n" rel="next">Subroutines</a>, Previous: <a href="Primary.html#Primary" accesskey="p" rel="previous">Primary</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> 132</div> 133 134 135 136</body> 137</html> 138