1 Author: Chris Chimelis <chris@debian.org>
2 Description: Add more documentation about profiling and -fprofile-arcs.
6 If more than one profile file is specified, the @code{gprof}
7 output shows the sum of the profile information in the given profile files.
9 +If you use gcc 2.95.x or 3.0 to compile your binaries, you may need
10 +to add the @samp{-fprofile-arcs} to the compile command line in order
11 +for the call graphs to be properly stored in gmon.out.
13 @code{Gprof} calculates the amount of time spent in each routine.
14 Next, these times are propagated along the edges of the call graph.
15 Cycles are discovered, and calls into a cycle are made to share the time
17 options. The same option, @samp{-pg}, alters either compilation or linking
18 to do what is necessary for profiling. Here are examples:
20 +If you use gcc 2.95.x or 3.0.x, you may need to add the
21 +@samp{-fprofile-arcs} option to the compile line along with @samp{-pg}
22 +in order to allow the call-graphs to be properly included in the gmon.out
26 cc -g -c myprog.c utils.c -pg
27 cc -o myprog myprog.o utils.o -pg