111 lines
		
	
	
	
		
			5.9 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			111 lines
		
	
	
	
		
			5.9 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<html lang="en">
 | 
						|
<head>
 | 
						|
<title>Analysis Options - GNU gprof</title>
 | 
						|
<meta http-equiv="Content-Type" content="text/html">
 | 
						|
<meta name="description" content="GNU gprof">
 | 
						|
<meta name="generator" content="makeinfo 4.7">
 | 
						|
<link title="Top" rel="start" href="index.html#Top">
 | 
						|
<link rel="up" href="Invoking.html#Invoking" title="Invoking">
 | 
						|
<link rel="prev" href="Output-Options.html#Output-Options" title="Output Options">
 | 
						|
<link rel="next" href="Miscellaneous-Options.html#Miscellaneous-Options" title="Miscellaneous Options">
 | 
						|
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
 | 
						|
<!--
 | 
						|
This file documents the gprof profiler of the GNU system.
 | 
						|
 | 
						|
Copyright (C) 1988, 92, 97, 98, 99, 2000, 2001, 2003, 2007 Free Software Foundation, Inc.
 | 
						|
 | 
						|
Permission is granted to copy, distribute and/or modify this document
 | 
						|
under the terms of the GNU Free Documentation License, Version 1.1
 | 
						|
or any later version published by the Free Software Foundation;
 | 
						|
with no Invariant Sections, with no Front-Cover Texts, and with no
 | 
						|
Back-Cover Texts.  A copy of the license is included in the
 | 
						|
section entitled ``GNU Free Documentation License''.
 | 
						|
 | 
						|
man end-->
 | 
						|
<meta http-equiv="Content-Style-Type" content="text/css">
 | 
						|
<style type="text/css"><!--
 | 
						|
  pre.display { font-family:inherit }
 | 
						|
  pre.format  { font-family:inherit }
 | 
						|
  pre.smalldisplay { font-family:inherit; font-size:smaller }
 | 
						|
  pre.smallformat  { font-family:inherit; font-size:smaller }
 | 
						|
  pre.smallexample { font-size:smaller }
 | 
						|
  pre.smalllisp    { font-size:smaller }
 | 
						|
  span.sc { font-variant:small-caps }
 | 
						|
  span.roman { font-family: serif; font-weight: normal; } 
 | 
						|
--></style>
 | 
						|
</head>
 | 
						|
<body>
 | 
						|
<div class="node">
 | 
						|
<p>
 | 
						|
<a name="Analysis-Options"></a>Next: <a rel="next" accesskey="n" href="Miscellaneous-Options.html#Miscellaneous-Options">Miscellaneous Options</a>,
 | 
						|
Previous: <a rel="previous" accesskey="p" href="Output-Options.html#Output-Options">Output Options</a>,
 | 
						|
Up: <a rel="up" accesskey="u" href="Invoking.html#Invoking">Invoking</a>
 | 
						|
<hr><br>
 | 
						|
</div>
 | 
						|
 | 
						|
<h3 class="section">4.2 Analysis Options</h3>
 | 
						|
 | 
						|
     <dl>
 | 
						|
<dt><code>-a</code><dt><code>--no-static</code><dd>The <span class="samp">-a</span> option causes <code>gprof</code> to suppress the printing of
 | 
						|
statically declared (private) functions.  (These are functions whose
 | 
						|
names are not listed as global, and which are not visible outside the
 | 
						|
file/function/block where they were defined.)  Time spent in these
 | 
						|
functions, calls to/from them, etc., will all be attributed to the
 | 
						|
function that was loaded directly before it in the executable file. 
 | 
						|
<!-- This is compatible with Unix @code{gprof}, but a bad idea. -->
 | 
						|
This option affects both the flat profile and the call graph.
 | 
						|
 | 
						|
     <br><dt><code>-c</code><dt><code>--static-call-graph</code><dd>The <span class="samp">-c</span> option causes the call graph of the program to be
 | 
						|
augmented by a heuristic which examines the text space of the object
 | 
						|
file and identifies function calls in the binary machine code. 
 | 
						|
Since normal call graph records are only generated when functions are
 | 
						|
entered, this option identifies children that could have been called,
 | 
						|
but never were.  Calls to functions that were not compiled with
 | 
						|
profiling enabled are also identified, but only if symbol table
 | 
						|
entries are present for them. 
 | 
						|
Calls to dynamic library routines are typically <em>not</em> found
 | 
						|
by this option. 
 | 
						|
Parents or children identified via this heuristic
 | 
						|
are indicated in the call graph with call counts of <span class="samp">0</span>.
 | 
						|
 | 
						|
     <br><dt><code>-D</code><dt><code>--ignore-non-functions</code><dd>The <span class="samp">-D</span> option causes <code>gprof</code> to ignore symbols which
 | 
						|
are not known to be functions.  This option will give more accurate
 | 
						|
profile data on systems where it is supported (Solaris and HPUX for
 | 
						|
example).
 | 
						|
 | 
						|
     <br><dt><code>-k </code><var>from</var><code>/</code><var>to</var><dd>The <span class="samp">-k</span> option allows you to delete from the call graph any arcs from
 | 
						|
symbols matching symspec <var>from</var> to those matching symspec <var>to</var>.
 | 
						|
 | 
						|
     <br><dt><code>-l</code><dt><code>--line</code><dd>The <span class="samp">-l</span> option enables line-by-line profiling, which causes
 | 
						|
histogram hits to be charged to individual source code lines,
 | 
						|
instead of functions.  This feature only works with programs compiled
 | 
						|
by older versions of the <code>gcc</code> compiler.  Newer versions of
 | 
						|
<code>gcc</code> are designed to work with the <code>gcov</code> tool instead.
 | 
						|
 | 
						|
     <p>If the program was compiled with basic-block counting enabled,
 | 
						|
this option will also identify how many times each line of
 | 
						|
code was executed. 
 | 
						|
While line-by-line profiling can help isolate where in a large function
 | 
						|
a program is spending its time, it also significantly increases
 | 
						|
the running time of <code>gprof</code>, and magnifies statistical
 | 
						|
inaccuracies. 
 | 
						|
See <a href="Sampling-Error.html#Sampling-Error">Statistical Sampling Error</a>.
 | 
						|
 | 
						|
     <br><dt><code>-m </code><var>num</var><dt><code>--min-count=</code><var>num</var><dd>This option affects execution count output only. 
 | 
						|
Symbols that are executed less than <var>num</var> times are suppressed.
 | 
						|
 | 
						|
     <br><dt><code>-n</code><var>symspec</var><dt><code>--time=</code><var>symspec</var><dd>The <span class="samp">-n</span> option causes <code>gprof</code>, in its call graph analysis,
 | 
						|
to only propagate times for symbols matching <var>symspec</var>.
 | 
						|
 | 
						|
     <br><dt><code>-N</code><var>symspec</var><dt><code>--no-time=</code><var>symspec</var><dd>The <span class="samp">-n</span> option causes <code>gprof</code>, in its call graph analysis,
 | 
						|
not to propagate times for symbols matching <var>symspec</var>.
 | 
						|
 | 
						|
     <br><dt><code>-z</code><dt><code>--display-unused-functions</code><dd>If you give the <span class="samp">-z</span> option, <code>gprof</code> will mention all
 | 
						|
functions in the flat profile, even those that were never called, and
 | 
						|
that had no time spent in them.  This is useful in conjunction with the
 | 
						|
<span class="samp">-c</span> option for discovering which routines were never called.
 | 
						|
 | 
						|
</dl>
 | 
						|
 | 
						|
   </body></html>
 | 
						|
 |