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
5Copyright (C) 1988-2021 Free Software Foundation, Inc.
6
7Permission is granted to copy, distribute and/or modify this document
8under the terms of the GNU Free Documentation License, Version 1.3
9or any later version published by the Free Software Foundation;
10with no Invariant Sections, with no Front-Cover Texts, and with no
11Back-Cover Texts.  A copy of the license is included in the
12section entitled "GNU Free Documentation License".
13 -->
14<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
15<head>
16<title>GNU gprof: Symspecs</title>
17
18<meta name="description" content="GNU gprof: Symspecs">
19<meta name="keywords" content="GNU gprof: Symspecs">
20<meta name="resource-type" content="document">
21<meta name="distribution" content="global">
22<meta name="Generator" content="makeinfo">
23<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
24<link href="index.html#Top" rel="start" title="Top">
25<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
26<link href="Invoking.html#Invoking" rel="up" title="Invoking">
27<link href="Output.html#Output" rel="next" title="Output">
28<link href="Deprecated-Options.html#Deprecated-Options" rel="previous" title="Deprecated Options">
29<style type="text/css">
30<!--
31a.summary-letter {text-decoration: none}
32blockquote.smallquotation {font-size: smaller}
33div.display {margin-left: 3.2em}
34div.example {margin-left: 3.2em}
35div.indentedblock {margin-left: 3.2em}
36div.lisp {margin-left: 3.2em}
37div.smalldisplay {margin-left: 3.2em}
38div.smallexample {margin-left: 3.2em}
39div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
40div.smalllisp {margin-left: 3.2em}
41kbd {font-style:oblique}
42pre.display {font-family: inherit}
43pre.format {font-family: inherit}
44pre.menu-comment {font-family: serif}
45pre.menu-preformatted {font-family: serif}
46pre.smalldisplay {font-family: inherit; font-size: smaller}
47pre.smallexample {font-size: smaller}
48pre.smallformat {font-family: inherit; font-size: smaller}
49pre.smalllisp {font-size: smaller}
50span.nocodebreak {white-space:nowrap}
51span.nolinebreak {white-space:nowrap}
52span.roman {font-family:serif; font-weight:normal}
53span.sansserif {font-family:sans-serif; font-weight:normal}
54ul.no-bullet {list-style: none}
55-->
56</style>
57
58
59</head>
60
61<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
62<a name="Symspecs"></a>
63<div class="header">
64<p>
65Previous: <a href="Deprecated-Options.html#Deprecated-Options" accesskey="p" rel="previous">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>
66</div>
67<hr>
68<a name="Symspecs-1"></a>
69<h3 class="section">4.5 Symspecs</h3>
70
71<p>Many of the output options allow functions to be included or excluded
72using <em>symspecs</em> (symbol specifications), which observe the
73following syntax:
74</p>
75<div class="example">
76<pre class="example">  filename_containing_a_dot
77| funcname_not_containing_a_dot
78| linenumber
79| ( [ any_filename ] `:' ( any_funcname | linenumber ) )
80</pre></div>
81
82<p>Here are some sample symspecs:
83</p>
84<dl compact="compact">
85<dt>&lsquo;<samp>main.c</samp>&rsquo;</dt>
86<dd><p>Selects everything in file <samp>main.c</samp>&mdash;the
87dot in the string tells <code>gprof</code> to interpret
88the string as a filename, rather than as
89a function name.  To select a file whose
90name does not contain a dot, a trailing colon
91should be specified.  For example, &lsquo;<samp>odd:</samp>&rsquo; is
92interpreted as the file named <samp>odd</samp>.
93</p>
94</dd>
95<dt>&lsquo;<samp>main</samp>&rsquo;</dt>
96<dd><p>Selects all functions named &lsquo;<samp>main</samp>&rsquo;.
97</p>
98<p>Note that there may be multiple instances of the same function name
99because some of the definitions may be local (i.e., static).  Unless a
100function name is unique in a program, you must use the colon notation
101explained below to specify a function from a specific source file.
102</p>
103<p>Sometimes, function names contain dots.  In such cases, it is necessary
104to add a leading colon to the name.  For example, &lsquo;<samp>:.mul</samp>&rsquo; selects
105function &lsquo;<samp>.mul</samp>&rsquo;.
106</p>
107<p>In some object file formats, symbols have a leading underscore.
108<code>gprof</code> will normally not print these underscores.  When you name a
109symbol in a symspec, you should type it exactly as <code>gprof</code> prints
110it in its output.  For example, if the compiler produces a symbol
111&lsquo;<samp>_main</samp>&rsquo; from your <code>main</code> function, <code>gprof</code> still prints
112it as &lsquo;<samp>main</samp>&rsquo; in its output, so you should use &lsquo;<samp>main</samp>&rsquo; in
113symspecs.
114</p>
115</dd>
116<dt>&lsquo;<samp>main.c:main</samp>&rsquo;</dt>
117<dd><p>Selects function &lsquo;<samp>main</samp>&rsquo; in file <samp>main.c</samp>.
118</p>
119</dd>
120<dt>&lsquo;<samp>main.c:134</samp>&rsquo;</dt>
121<dd><p>Selects line 134 in file <samp>main.c</samp>.
122</p></dd>
123</dl>
124
125
126
127
128</body>
129</html>
130