Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

Callers.html 5.6KB

3 lat temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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>Callers (GNU gprof)</title>
  16. <meta name="description" content="Callers (GNU gprof)">
  17. <meta name="keywords" content="Callers (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="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.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="Callers"></a>
  56. <div class="header">
  57. <p>
  58. 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>
  59. </div>
  60. <hr>
  61. <a name="Lines-for-a-Function_0027s-Callers"></a>
  62. <h4 class="subsection">5.2.2 Lines for a Function&rsquo;s Callers</h4>
  63. <p>A function&rsquo;s entry has a line for each function it was called by.
  64. These lines&rsquo; fields correspond to the fields of the primary line, but
  65. their meanings are different because of the difference in context.
  66. </p>
  67. <p>For reference, we repeat two lines from the entry for the function
  68. <code>report</code>, the primary line and one caller-line preceding it, together
  69. with the heading line that 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. 0.00 0.05 1/1 main [2]
  75. [3] 100.0 0.00 0.05 1 report [3]
  76. </pre></div>
  77. <p>Here are the meanings of the fields in the caller-line for <code>report</code>
  78. called from <code>main</code>:
  79. </p>
  80. <dl compact="compact">
  81. <dt><code>self</code></dt>
  82. <dd><p>An estimate of the amount of time spent in <code>report</code> itself when it was
  83. called from <code>main</code>.
  84. </p>
  85. </dd>
  86. <dt><code>children</code></dt>
  87. <dd><p>An estimate of the amount of time spent in subroutines of <code>report</code>
  88. when <code>report</code> was called from <code>main</code>.
  89. </p>
  90. <p>The sum of the <code>self</code> and <code>children</code> fields is an estimate
  91. of the amount of time spent within calls to <code>report</code> from <code>main</code>.
  92. </p>
  93. </dd>
  94. <dt><code>called</code></dt>
  95. <dd><p>Two numbers: the number of times <code>report</code> was called from <code>main</code>,
  96. followed by the total number of non-recursive calls to <code>report</code> from
  97. all its callers.
  98. </p>
  99. </dd>
  100. <dt><code>name and index number</code></dt>
  101. <dd><p>The name of the caller of <code>report</code> to which this line applies,
  102. followed by the caller&rsquo;s index number.
  103. </p>
  104. <p>Not all functions have entries in the call graph; some
  105. options to <code>gprof</code> request the omission of certain functions.
  106. When a caller has no entry of its own, it still has caller-lines
  107. in the entries of the functions it calls.
  108. </p>
  109. <p>If the caller is part of a recursion cycle, the cycle number is
  110. printed between the name and the index number.
  111. </p></dd>
  112. </dl>
  113. <p>If the identity of the callers of a function cannot be determined, a
  114. dummy caller-line is printed which has &lsquo;<samp>&lt;spontaneous&gt;</samp>&rsquo; as the
  115. &ldquo;caller&rsquo;s name&rdquo; and all other fields blank. This can happen for
  116. signal handlers.
  117. </p>
  118. <hr>
  119. <div class="header">
  120. <p>
  121. 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>
  122. </div>
  123. </body>
  124. </html>