Analysis-Options.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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: Analysis Options</title>
  15. <meta name="description" content="GNU gprof: Analysis Options">
  16. <meta name="keywords" content="GNU gprof: Analysis Options">
  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="Invoking.html#Invoking" rel="up" title="Invoking">
  24. <link href="Miscellaneous-Options.html#Miscellaneous-Options" rel="next" title="Miscellaneous Options">
  25. <link href="Output-Options.html#Output-Options" rel="prev" title="Output Options">
  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="Analysis-Options"></a>
  57. <div class="header">
  58. <p>
  59. Next: <a href="Miscellaneous-Options.html#Miscellaneous-Options" accesskey="n" rel="next">Miscellaneous Options</a>, Previous: <a href="Output-Options.html#Output-Options" accesskey="p" rel="prev">Output Options</a>, Up: <a href="Invoking.html#Invoking" accesskey="u" rel="up">Invoking</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
  60. </div>
  61. <hr>
  62. <a name="Analysis-Options-1"></a>
  63. <h3 class="section">4.2 Analysis Options</h3>
  64. <dl compact="compact">
  65. <dt><code>-a</code></dt>
  66. <dt><code>--no-static</code></dt>
  67. <dd><p>The &lsquo;<samp>-a</samp>&rsquo; option causes <code>gprof</code> to suppress the printing of
  68. statically declared (private) functions. (These are functions whose
  69. names are not listed as global, and which are not visible outside the
  70. file/function/block where they were defined.) Time spent in these
  71. functions, calls to/from them, etc., will all be attributed to the
  72. function that was loaded directly before it in the executable file.
  73. This option affects both the flat profile and the call graph.
  74. </p>
  75. </dd>
  76. <dt><code>-c</code></dt>
  77. <dt><code>--static-call-graph</code></dt>
  78. <dd><p>The &lsquo;<samp>-c</samp>&rsquo; option causes the call graph of the program to be
  79. augmented by a heuristic which examines the text space of the object
  80. file and identifies function calls in the binary machine code.
  81. Since normal call graph records are only generated when functions are
  82. entered, this option identifies children that could have been called,
  83. but never were. Calls to functions that were not compiled with
  84. profiling enabled are also identified, but only if symbol table
  85. entries are present for them.
  86. Calls to dynamic library routines are typically <em>not</em> found
  87. by this option.
  88. Parents or children identified via this heuristic
  89. are indicated in the call graph with call counts of &lsquo;<samp>0</samp>&rsquo;.
  90. </p>
  91. </dd>
  92. <dt><code>-D</code></dt>
  93. <dt><code>--ignore-non-functions</code></dt>
  94. <dd><p>The &lsquo;<samp>-D</samp>&rsquo; option causes <code>gprof</code> to ignore symbols which
  95. are not known to be functions. This option will give more accurate
  96. profile data on systems where it is supported (Solaris and HPUX for
  97. example).
  98. </p>
  99. </dd>
  100. <dt><code>-k <var>from</var>/<var>to</var></code></dt>
  101. <dd><p>The &lsquo;<samp>-k</samp>&rsquo; option allows you to delete from the call graph any arcs from
  102. symbols matching symspec <var>from</var> to those matching symspec <var>to</var>.
  103. </p>
  104. </dd>
  105. <dt><code>-l</code></dt>
  106. <dt><code>--line</code></dt>
  107. <dd><p>The &lsquo;<samp>-l</samp>&rsquo; option enables line-by-line profiling, which causes
  108. histogram hits to be charged to individual source code lines,
  109. instead of functions. This feature only works with programs compiled
  110. by older versions of the <code>gcc</code> compiler. Newer versions of
  111. <code>gcc</code> are designed to work with the <code>gcov</code> tool instead.
  112. </p>
  113. <p>If the program was compiled with basic-block counting enabled,
  114. this option will also identify how many times each line of
  115. code was executed.
  116. While line-by-line profiling can help isolate where in a large function
  117. a program is spending its time, it also significantly increases
  118. the running time of <code>gprof</code>, and magnifies statistical
  119. inaccuracies.
  120. See <a href="Sampling-Error.html#Sampling-Error">Statistical Sampling Error</a>.
  121. </p>
  122. </dd>
  123. <dt><code>--inline-file-names</code></dt>
  124. <dd><p>This option causes <code>gprof</code> to print the source file after each
  125. symbol in both the flat profile and the call graph. The full path to the
  126. file is printed if used with the &lsquo;<samp>-L</samp>&rsquo; option.
  127. </p>
  128. </dd>
  129. <dt><code>-m <var>num</var></code></dt>
  130. <dt><code>--min-count=<var>num</var></code></dt>
  131. <dd><p>This option affects execution count output only.
  132. Symbols that are executed less than <var>num</var> times are suppressed.
  133. </p>
  134. </dd>
  135. <dt><code>-n<var>symspec</var></code></dt>
  136. <dt><code>--time=<var>symspec</var></code></dt>
  137. <dd><p>The &lsquo;<samp>-n</samp>&rsquo; option causes <code>gprof</code>, in its call graph analysis,
  138. to only propagate times for symbols matching <var>symspec</var>.
  139. </p>
  140. </dd>
  141. <dt><code>-N<var>symspec</var></code></dt>
  142. <dt><code>--no-time=<var>symspec</var></code></dt>
  143. <dd><p>The &lsquo;<samp>-n</samp>&rsquo; option causes <code>gprof</code>, in its call graph analysis,
  144. not to propagate times for symbols matching <var>symspec</var>.
  145. </p>
  146. </dd>
  147. <dt><code>-S<var>filename</var></code></dt>
  148. <dt><code>--external-symbol-table=<var>filename</var></code></dt>
  149. <dd><p>The &lsquo;<samp>-S</samp>&rsquo; option causes <code>gprof</code> to read an external symbol table
  150. file, such as <samp>/proc/kallsyms</samp>, rather than read the symbol table
  151. from the given object file (the default is <code>a.out</code>). This is useful
  152. for profiling kernel modules.
  153. </p>
  154. </dd>
  155. <dt><code>-z</code></dt>
  156. <dt><code>--display-unused-functions</code></dt>
  157. <dd><p>If you give the &lsquo;<samp>-z</samp>&rsquo; option, <code>gprof</code> will mention all
  158. functions in the flat profile, even those that were never called, and
  159. that had no time spent in them. This is useful in conjunction with the
  160. &lsquo;<samp>-c</samp>&rsquo; option for discovering which routines were never called.
  161. </p>
  162. </dd>
  163. </dl>
  164. <hr>
  165. <div class="header">
  166. <p>
  167. Next: <a href="Miscellaneous-Options.html#Miscellaneous-Options" accesskey="n" rel="next">Miscellaneous Options</a>, Previous: <a href="Output-Options.html#Output-Options" accesskey="p" rel="prev">Output Options</a>, Up: <a href="Invoking.html#Invoking" accesskey="u" rel="up">Invoking</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
  168. </div>
  169. </body>
  170. </html>