Callers.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. Copyright (C) 1988-2017 Free Software Foundation, Inc.
  5. Permission is granted to copy, distribute and/or modify this document
  6. under the terms of the GNU Free Documentation License, Version 1.3
  7. or any later version published by the Free Software Foundation;
  8. with no Invariant Sections, with no Front-Cover Texts, and with no
  9. Back-Cover Texts. A copy of the license is included in the
  10. section entitled "GNU Free Documentation License".
  11. -->
  12. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <title>GNU gprof: Callers</title>
  15. <meta name="description" content="GNU gprof: Callers">
  16. <meta name="keywords" content="GNU gprof: Callers">
  17. <meta name="resource-type" content="document">
  18. <meta name="distribution" content="global">
  19. <meta name="Generator" content="makeinfo">
  20. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  21. <link href="index.html#Top" rel="start" title="Top">
  22. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  23. <link href="Call-Graph.html#Call-Graph" rel="up" title="Call Graph">
  24. <link href="Subroutines.html#Subroutines" rel="next" title="Subroutines">
  25. <link href="Primary.html#Primary" rel="prev" title="Primary">
  26. <style type="text/css">
  27. <!--
  28. a.summary-letter {text-decoration: none}
  29. blockquote.smallquotation {font-size: smaller}
  30. div.display {margin-left: 3.2em}
  31. div.example {margin-left: 3.2em}
  32. div.indentedblock {margin-left: 3.2em}
  33. div.lisp {margin-left: 3.2em}
  34. div.smalldisplay {margin-left: 3.2em}
  35. div.smallexample {margin-left: 3.2em}
  36. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  37. div.smalllisp {margin-left: 3.2em}
  38. kbd {font-style:oblique}
  39. pre.display {font-family: inherit}
  40. pre.format {font-family: inherit}
  41. pre.menu-comment {font-family: serif}
  42. pre.menu-preformatted {font-family: serif}
  43. pre.smalldisplay {font-family: inherit; font-size: smaller}
  44. pre.smallexample {font-size: smaller}
  45. pre.smallformat {font-family: inherit; font-size: smaller}
  46. pre.smalllisp {font-size: smaller}
  47. span.nocodebreak {white-space:nowrap}
  48. span.nolinebreak {white-space:nowrap}
  49. span.roman {font-family:serif; font-weight:normal}
  50. span.sansserif {font-family:sans-serif; font-weight:normal}
  51. ul.no-bullet {list-style: none}
  52. -->
  53. </style>
  54. </head>
  55. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  56. <a name="Callers"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="Subroutines.html#Subroutines" accesskey="n" rel="next">Subroutines</a>, Previous: <a href="Primary.html#Primary" accesskey="p" rel="prev">Primary</a>, Up: <a href="Call-Graph.html#Call-Graph" accesskey="u" rel="up">Call Graph</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="Lines-for-a-Function_0027s-Callers"></a>
  63. <h4 class="subsection">5.2.2 Lines for a Function&rsquo;s Callers</h4>
  64. <p>A function&rsquo;s entry has a line for each function it was called by.
  65. These lines&rsquo; fields correspond to the fields of the primary line, but
  66. their meanings are different because of the difference in context.
  67. </p>
  68. <p>For reference, we repeat two lines from the entry for the function
  69. <code>report</code>, the primary line and one caller-line preceding it, together
  70. with the heading line that shows the names of the fields:
  71. </p>
  72. <div class="smallexample">
  73. <pre class="smallexample">index % time self children called name
  74. &hellip;
  75. 0.00 0.05 1/1 main [2]
  76. [3] 100.0 0.00 0.05 1 report [3]
  77. </pre></div>
  78. <p>Here are the meanings of the fields in the caller-line for <code>report</code>
  79. called from <code>main</code>:
  80. </p>
  81. <dl compact="compact">
  82. <dt><code>self</code></dt>
  83. <dd><p>An estimate of the amount of time spent in <code>report</code> itself when it was
  84. called from <code>main</code>.
  85. </p>
  86. </dd>
  87. <dt><code>children</code></dt>
  88. <dd><p>An estimate of the amount of time spent in subroutines of <code>report</code>
  89. when <code>report</code> was called from <code>main</code>.
  90. </p>
  91. <p>The sum of the <code>self</code> and <code>children</code> fields is an estimate
  92. of the amount of time spent within calls to <code>report</code> from <code>main</code>.
  93. </p>
  94. </dd>
  95. <dt><code>called</code></dt>
  96. <dd><p>Two numbers: the number of times <code>report</code> was called from <code>main</code>,
  97. followed by the total number of non-recursive calls to <code>report</code> from
  98. all its callers.
  99. </p>
  100. </dd>
  101. <dt><code>name and index number</code></dt>
  102. <dd><p>The name of the caller of <code>report</code> to which this line applies,
  103. followed by the caller&rsquo;s index number.
  104. </p>
  105. <p>Not all functions have entries in the call graph; some
  106. options to <code>gprof</code> request the omission of certain functions.
  107. When a caller has no entry of its own, it still has caller-lines
  108. in the entries of the functions it calls.
  109. </p>
  110. <p>If the caller is part of a recursion cycle, the cycle number is
  111. printed between the name and the index number.
  112. </p></dd>
  113. </dl>
  114. <p>If the identity of the callers of a function cannot be determined, a
  115. dummy caller-line is printed which has &lsquo;<samp>&lt;spontaneous&gt;</samp>&rsquo; as the
  116. &ldquo;caller&rsquo;s name&rdquo; and all other fields blank. This can happen for
  117. signal handlers.
  118. </p>
  119. <hr>
  120. <div class="header">
  121. <p>
  122. Next: <a href="Subroutines.html#Subroutines" accesskey="n" rel="next">Subroutines</a>, Previous: <a href="Primary.html#Primary" accesskey="p" rel="prev">Primary</a>, Up: <a href="Call-Graph.html#Call-Graph" accesskey="u" rel="up">Call Graph</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
  123. </div>
  124. </body>
  125. </html>