您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

157 行
5.8KB

  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-2020 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 6.5, http://www.gnu.org/software/texinfo/ -->
  13. <head>
  14. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  15. <title>Primary (GNU gprof)</title>
  16. <meta name="description" content="Primary (GNU gprof)">
  17. <meta name="keywords" content="Primary (GNU gprof)">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  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.indentedblock {margin-right: 0em}
  30. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.lisp {margin-left: 3.2em}
  35. div.smalldisplay {margin-left: 3.2em}
  36. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  48. span.roman {font-family: initial; font-weight: normal}
  49. span.sansserif {font-family: sans-serif; font-weight: normal}
  50. ul.no-bullet {list-style: none}
  51. -->
  52. </style>
  53. </head>
  54. <body lang="en">
  55. <a name="Primary"></a>
  56. <div class="header">
  57. <p>
  58. 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>
  59. </div>
  60. <hr>
  61. <a name="The-Primary-Line"></a>
  62. <h4 class="subsection">5.2.1 The Primary Line</h4>
  63. <p>The <em>primary line</em> in a call graph entry is the line that
  64. describes the function which the entry is about and gives the overall
  65. statistics for this function.
  66. </p>
  67. <p>For reference, we repeat the primary line from the entry for function
  68. <code>report</code> in our main example, together with the heading line that
  69. shows the names of the fields:
  70. </p>
  71. <div class="smallexample">
  72. <pre class="smallexample">index % time self children called name
  73. &hellip;
  74. [3] 100.0 0.00 0.05 1 report [3]
  75. </pre></div>
  76. <p>Here is what the fields in the primary line mean:
  77. </p>
  78. <dl compact="compact">
  79. <dt><code>index</code></dt>
  80. <dd><p>Entries are numbered with consecutive integers. Each function
  81. therefore has an index number, which appears at the beginning of its
  82. primary line.
  83. </p>
  84. <p>Each cross-reference to a function, as a caller or subroutine of
  85. another, gives its index number as well as its name. The index number
  86. guides you if you wish to look for the entry for that function.
  87. </p>
  88. </dd>
  89. <dt><code>% time</code></dt>
  90. <dd><p>This is the percentage of the total time that was spent in this
  91. function, including time spent in subroutines called from this
  92. function.
  93. </p>
  94. <p>The time spent in this function is counted again for the callers of
  95. this function. Therefore, adding up these percentages is meaningless.
  96. </p>
  97. </dd>
  98. <dt><code>self</code></dt>
  99. <dd><p>This is the total amount of time spent in this function. This
  100. should be identical to the number printed in the <code>seconds</code> field
  101. for this function in the flat profile.
  102. </p>
  103. </dd>
  104. <dt><code>children</code></dt>
  105. <dd><p>This is the total amount of time spent in the subroutine calls made by
  106. this function. This should be equal to the sum of all the <code>self</code>
  107. and <code>children</code> entries of the children listed directly below this
  108. function.
  109. </p>
  110. </dd>
  111. <dt><code>called</code></dt>
  112. <dd><p>This is the number of times the function was called.
  113. </p>
  114. <p>If the function called itself recursively, there are two numbers,
  115. separated by a &lsquo;<samp>+</samp>&rsquo;. The first number counts non-recursive calls,
  116. and the second counts recursive calls.
  117. </p>
  118. <p>In the example above, the function <code>report</code> was called once from
  119. <code>main</code>.
  120. </p>
  121. </dd>
  122. <dt><code>name</code></dt>
  123. <dd><p>This is the name of the current function. The index number is
  124. repeated after it.
  125. </p>
  126. <p>If the function is part of a cycle of recursion, the cycle number is
  127. printed between the function&rsquo;s name and the index number
  128. (see <a href="Cycles.html#Cycles">How Mutually Recursive Functions Are Described</a>).
  129. For example, if function <code>gnurr</code> is part of
  130. cycle number one, and has index number twelve, its primary line would
  131. be end like this:
  132. </p>
  133. <div class="example">
  134. <pre class="example">gnurr &lt;cycle 1&gt; [12]
  135. </pre></div>
  136. </dd>
  137. </dl>
  138. <hr>
  139. <div class="header">
  140. <p>
  141. 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>
  142. </div>
  143. </body>
  144. </html>