Primary.html 5.9 KB

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