This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Generation process for cpp.1


On Sun, 12 Nov 2000, Zack Weinberg wrote:

> Give this patch a spin?  It should handle everything you listed.

Sorry, running it on my modified gcov.texi gives

Can't locate object method "U" via package "gnu" at ../texi2pod.pl line 58, <STDIN> line 105.

The section ending with line 105 is:

@c man begin DESCRIPTION

@code{gcov} is a test coverage program.  Use it in concert with @sc{gnu}
CC to analyze your programs to help create more efficient, faster
running code.  You can use @code{gcov} as a profiling tool to help
discover where your optimization efforts will best affect your code.  You
can also use @code{gcov} along with the other profiling tool,
@code{gprof}, to assess which parts of your code use the greatest amount
of computing time.

Profiling tools help you analyze your code's performance.  Using a
profiler such as @code{gcov} or @code{gprof}, you can find out some
basic performance statistics, such as:

@itemize @bullet
@item
how often each line of code executes

@item
what lines of code are actually executed

@item
how much computing time each section of code uses
@end itemize

Once you know these things about how your code works when compiled, you
can look at each module to see which modules should be optimized.
@code{gcov} helps you determine where to work on optimization.

Software developers also use coverage testing in concert with
testsuites, to make sure software is actually good enough for a release.
Testsuites can verify that a program works as expected; a coverage
program tests to see how much of the program is exercised by the
testsuite.  Developers can then determine what kinds of test cases need
to be added to the testsuites to create both better testing and a better
final product.

You should compile your code without optimization if you plan to use
@code{gcov} because the optimization, by combining some lines of code
into one function, may not give you as much information as you need to
look for `hot spots' where the code is using a great deal of computer
time.  Likewise, because @code{gcov} accumulates statistics by line (at
the lowest resolution), it works best with a programming style that
places only one statement on each line.  If you use complicated macros
that expand to loops or to other control structures, the statistics are
less helpful---they only report on the line where the macro call
appears.  If your complex macros behave like functions, you can replace
them with inline functions to solve this problem.

@code{gcov} creates a logfile called @file{@var{sourcefile}.gcov} which
indicates how many times each line of a source file @file{@var{sourcefile}.c}
has executed.  You can use these logfiles along with @code{gprof} to aid
in fine-tuning the performance of your programs.  @code{gprof} gives
timing information you can use along with the information you get from
@code{gcov}.

@code{gcov} works only on code compiled with @sc{gnu} CC.  It is not
compatible with any other profiling or test coverage mechanism.

@c man end

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]