Symspecs.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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: Symspecs</title>
  15. <meta name="description" content="GNU gprof: Symspecs">
  16. <meta name="keywords" content="GNU gprof: Symspecs">
  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="Output.html#Output" rel="next" title="Output">
  25. <link href="Deprecated-Options.html#Deprecated-Options" rel="prev" title="Deprecated 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="Symspecs"></a>
  57. <div class="header">
  58. <p>
  59. Previous: <a href="Deprecated-Options.html#Deprecated-Options" accesskey="p" rel="prev">Deprecated 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="Symspecs-1"></a>
  63. <h3 class="section">4.5 Symspecs</h3>
  64. <p>Many of the output options allow functions to be included or excluded
  65. using <em>symspecs</em> (symbol specifications), which observe the
  66. following syntax:
  67. </p>
  68. <div class="example">
  69. <pre class="example"> filename_containing_a_dot
  70. | funcname_not_containing_a_dot
  71. | linenumber
  72. | ( [ any_filename ] `:' ( any_funcname | linenumber ) )
  73. </pre></div>
  74. <p>Here are some sample symspecs:
  75. </p>
  76. <dl compact="compact">
  77. <dt>&lsquo;<samp>main.c</samp>&rsquo;</dt>
  78. <dd><p>Selects everything in file <samp>main.c</samp>&mdash;the
  79. dot in the string tells <code>gprof</code> to interpret
  80. the string as a filename, rather than as
  81. a function name. To select a file whose
  82. name does not contain a dot, a trailing colon
  83. should be specified. For example, &lsquo;<samp>odd:</samp>&rsquo; is
  84. interpreted as the file named <samp>odd</samp>.
  85. </p>
  86. </dd>
  87. <dt>&lsquo;<samp>main</samp>&rsquo;</dt>
  88. <dd><p>Selects all functions named &lsquo;<samp>main</samp>&rsquo;.
  89. </p>
  90. <p>Note that there may be multiple instances of the same function name
  91. because some of the definitions may be local (i.e., static). Unless a
  92. function name is unique in a program, you must use the colon notation
  93. explained below to specify a function from a specific source file.
  94. </p>
  95. <p>Sometimes, function names contain dots. In such cases, it is necessary
  96. to add a leading colon to the name. For example, &lsquo;<samp>:.mul</samp>&rsquo; selects
  97. function &lsquo;<samp>.mul</samp>&rsquo;.
  98. </p>
  99. <p>In some object file formats, symbols have a leading underscore.
  100. <code>gprof</code> will normally not print these underscores. When you name a
  101. symbol in a symspec, you should type it exactly as <code>gprof</code> prints
  102. it in its output. For example, if the compiler produces a symbol
  103. &lsquo;<samp>_main</samp>&rsquo; from your <code>main</code> function, <code>gprof</code> still prints
  104. it as &lsquo;<samp>main</samp>&rsquo; in its output, so you should use &lsquo;<samp>main</samp>&rsquo; in
  105. symspecs.
  106. </p>
  107. </dd>
  108. <dt>&lsquo;<samp>main.c:main</samp>&rsquo;</dt>
  109. <dd><p>Selects function &lsquo;<samp>main</samp>&rsquo; in file <samp>main.c</samp>.
  110. </p>
  111. </dd>
  112. <dt>&lsquo;<samp>main.c:134</samp>&rsquo;</dt>
  113. <dd><p>Selects line 134 in file <samp>main.c</samp>.
  114. </p></dd>
  115. </dl>
  116. </body>
  117. </html>