This preview shows page 1. Sign up to view the full content.
Unformatted text preview: ted to determine how much time the different parts of the program require. It can be very useful for identifying the parts of a program on which we should focus our optimization efforts. One strength of proﬁling is that it can be performed while running the actual program on realistic benchmark data. Unix systems provide the proﬁling program GPROF. This program generates two forms of information. First, it determines how much CPU time was spent for each of the functions in the program. Second, it computes a count of how many times each function gets called, categorized by which function performs the call. Both forms of information can be quite useful. The timings give a sense of the relative importance of the different functions in determining the overall run time. The calling information allows us to understand the dynamic behavior of the program. Proﬁling with GPROF requires three steps. We show this for a C program prog.c, to be running with command line argument file.txt: 1. The program must be compiled and linked for proﬁlin...
View Full Document
- Spring '10
- The American