gprof: Symspecs

1 
1 4.5 Symspecs
1 ============
1 
1 Many of the output options allow functions to be included or excluded
1 using "symspecs" (symbol specifications), which observe the following
1 syntax:
1 
1        filename_containing_a_dot
1      | funcname_not_containing_a_dot
1      | linenumber
1      | ( [ any_filename ] `:' ( any_funcname | linenumber ) )
1 
1    Here are some sample symspecs:
1 
1 'main.c'
1      Selects everything in file 'main.c'--the dot in the string tells
1      'gprof' to interpret the string as a filename, rather than as a
1      function name.  To select a file whose name does not contain a dot,
1      a trailing colon should be specified.  For example, 'odd:' is
1      interpreted as the file named 'odd'.
1 
1 'main'
1      Selects all functions named 'main'.
1 
1      Note that there may be multiple instances of the same function name
1      because some of the definitions may be local (i.e., static).
1      Unless a function name is unique in a program, you must use the
1      colon notation explained below to specify a function from a
1      specific source file.
1 
1      Sometimes, function names contain dots.  In such cases, it is
1      necessary to add a leading colon to the name.  For example, ':.mul'
1      selects function '.mul'.
1 
1      In some object file formats, symbols have a leading underscore.
1      'gprof' will normally not print these underscores.  When you name a
1      symbol in a symspec, you should type it exactly as 'gprof' prints
1      it in its output.  For example, if the compiler produces a symbol
1      '_main' from your 'main' function, 'gprof' still prints it as
1      'main' in its output, so you should use 'main' in symspecs.
1 
1 'main.c:main'
1      Selects function 'main' in file 'main.c'.
1 
1 'main.c:134'
1      Selects line 134 in file 'main.c'.
1