Home | History | Annotate | Download | only in info

Lines Matching full:program

6 * gprof: (gprof).                Profiling your program's execution
24 Profiling a Program: Where Does It Spend Its Time?
28 to determine which parts of a program are taking most of the execution
42 * Compiling:: How to compile your program for profiling.
43 * Executing:: Executing your program to generate profile data
60 Profiling allows you to learn where your program spent its time and
62 This information can show you which pieces of your program are slower
64 program execute faster. It can also tell you which functions are being
69 execution of your program, it can be used on programs that are too
71 your program is run will affect the information that shows up in the
72 profile data. If you don't use some feature of your program while it
78 * You must compile and link your program with profiling enabled.
79 *Note Compiling a Program for Profiling: Compiling.
81 * You must execute your program to generate a profile data file.
82 *Note Executing the Program: Executing.
91 The "flat profile" shows how much time your program spent in each
103 The "annotated source" listing is a copy of the program's source
104 code, labeled with the number of times each line of the program was
114 2 Compiling a Program for Profiling
117 The first step in generating profile information for your program is to
124 To link the program for profiling, if you use a compiler such as `cc'
167 If you are running the program on a system which supports shared
170 initialised. This is usually detected by the program encountering a
178 If you compile only some of the modules of the program with `-pg',
179 you can still profile the program, but you won't get complete
199 every function in their program. This can be used to implement an
205 3 Executing the Program
208 Once the program is compiled for profiling, you must run it in order to
209 generate the information that `gprof' needs. Simply run the program as
210 usual, using the normal arguments, file names, etc. The program should
215 The way you run the program--the arguments and input that you give
217 The profile data will describe the parts of the program that were
219 command you give to your program is to quit, the profile data will show
222 Your program will write the profile data into a file called
225 tell the program to write the profile data under a different name, but
229 In order to write the `gmon.out' file properly, your program must
234 The `gmon.out' file is written in the program's _current working
235 directory_ at the time it exits. This means that if your program calls
237 program `chdir''d to. If you don't have permission to write in this
264 interpret the information in it. The `gprof' program prints a flat
412 suggested function ordering for the program based on profiling
414 tlb and cache behavior for the program on systems which support
424 .o link line ordering for the program based on profiling data.
426 cache behavior for the program on systems which do not support
433 similar to the output of the program `nm'.
445 --extern-only --defined-only -v --print-file-name program-name'.
493 The `-c' option causes the call graph of the program to be
524 If the program was compiled with basic-block counting enabled,
527 in a large function a program is spending its time, it also
679 Unless a function name is unique in a program, you must use the
729 The "flat profile" shows the total amount of time your program spent
733 and didn't run long enough to show up on the program counter histogram,
736 This is part of a flat profile for a small program:
770 program's total execution time was 0.06 seconds, as indicated by the
773 the samples occurred while the program was in the `open' function, as
792 This is the percentage of the total execution time your program
838 Here is a sample call from a small program. This call came from the
1127 (The entire call graph for this program contains in addition an entry
1204 `gprof''s `-l' option causes the program to perform "line-by-line"
1208 Newer versions of `gcc' use a different program - `gcov' - to display
1211 With the older versions of `gcc' the program usually has to be
1214 versions of `gcc' the program had to be compiled with the `-a' command
1248 Now let's look at some of `gprof''s output from the same program run,
1295 the program's source code, each function labeled with the number of
1300 augments your program with basic-block counting code, in addition to
1304 program.
1336 A program augmented for basic-block counting can be analyzed with
1394 vary from run to run if your program is deterministic and single
1419 information. If the program's _total_ run-time is large, a small
1421 insignificant fraction of the whole program's time. Usually this means
1424 One way to get more accuracy is to give your program more (but
1429 1. Run your program once.
1433 3. Run your program again, the same as before.
1457 assumption about your program that might or might not be true.
1468 while other callers of `foo' pass other arguments. In this program,
1483 How can I get more exact information about hot spots in my program?
1486 the best way to get finer-grained information on where the program
1493 How do I find which lines in my program were executed the most times?
1494 Use the `gcov' program.
1496 How do I find which lines in my program called a particular function?
1500 How do I analyze a program that runs for less than a second?
1512 If your program is completely deterministic, all the call counts
1560 * Implementation:: How a program collects profiling information
1571 Profiling works by changing how every function in your program is
1575 This change is made by the compiler when your program is compiled with
1602 you link your program with `gcc ... -pg', it automatically uses the
1605 Profiling also involves watching your program as it runs, and
1606 keeping a histogram of where the program counter happens to be every
1607 now and then. Typically the program counter is looked at around 100
1613 the kernel, along with a scale factor that determines how the program's
1616 every tick of the system clock (assuming the profiled program is
1617 running), the value of the program counter is examined and the
1626 same operation of examining the program counter and incrementing a slot
1654 typically registered using `atexit()' to be called as the program
1659 The output from `gprof' gives no indication of parts of your program
1661 of the program counter are taken at fixed intervals of the program's
1663 nothing about time that your program was not running. For example, a
1664 part of the program that creates so much data that it cannot all fit in
1734 program execution. Arcs are specified by a pair of addresses: the
1986 free program should come with manuals providing the same freedoms
2436 If your document contains nontrivial examples of program code, we