Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

130 lines
5.3KB

  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>Subroutines (GNU gprof)</title>
  16. <meta name="description" content="Subroutines (GNU gprof)">
  17. <meta name="keywords" content="Subroutines (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="Cycles.html#Cycles" rel="next" title="Cycles">
  25. <link href="Callers.html#Callers" rel="prev" title="Callers">
  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="Subroutines"></a>
  56. <div class="header">
  57. <p>
  58. Next: <a href="Cycles.html#Cycles" accesskey="n" rel="next">Cycles</a>, Previous: <a href="Callers.html#Callers" accesskey="p" rel="prev">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="Lines-for-a-Function_0027s-Subroutines"></a>
  62. <h4 class="subsection">5.2.3 Lines for a Function&rsquo;s Subroutines</h4>
  63. <p>A function&rsquo;s entry has a line for each of its subroutines&mdash;in other
  64. words, a line for each other function that it called. These lines&rsquo;
  65. fields correspond to the fields of the primary line, but their meanings
  66. 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>main</code>, the primary line and a line for a subroutine, 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. [2] 100.0 0.00 0.05 1 main [2]
  76. 0.00 0.05 1/1 report [3]
  77. </pre></div>
  78. <p>Here are the meanings of the fields in the subroutine-line for <code>main</code>
  79. calling <code>report</code>:
  80. </p>
  81. <dl compact="compact">
  82. <dt><code>self</code></dt>
  83. <dd><p>An estimate of the amount of time spent directly within <code>report</code>
  84. when <code>report</code> was 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 total time spent in 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 calls to <code>report</code> from <code>main</code>
  97. followed by the total number of non-recursive calls to <code>report</code>.
  98. This ratio is used to determine how much of <code>report</code>&rsquo;s <code>self</code>
  99. and <code>children</code> time gets credited to <code>main</code>.
  100. See <a href="Assumptions.html#Assumptions">Estimating <code>children</code> Times</a>.
  101. </p>
  102. </dd>
  103. <dt><code>name</code></dt>
  104. <dd><p>The name of the subroutine of <code>main</code> to which this line applies,
  105. followed by the subroutine&rsquo;s index number.
  106. </p>
  107. <p>If the caller is part of a recursion cycle, the cycle number is
  108. printed between the name and the index number.
  109. </p></dd>
  110. </dl>
  111. <hr>
  112. <div class="header">
  113. <p>
  114. Next: <a href="Cycles.html#Cycles" accesskey="n" rel="next">Cycles</a>, Previous: <a href="Callers.html#Callers" accesskey="p" rel="prev">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>
  115. </div>
  116. </body>
  117. </html>