gprof: a Call Graph Execution Profiler

gprof: a Call Graph Execution Profiler,10.1145/800230.806987,Sigplan Notices,Susan L. Graham,Peter B. Kessler,Marshall K. McKusick

gprof: a Call Graph Execution Profiler   (Citations: 406)
BibTex | RIS | RefWorks Download
Large complex programs are composed of many small routines that implement abstractions for the routines that call them. To be useful, an execution profiler must attribute execution time in a way that is significant for the logical structure of a program as well as for its textual decomposition. This data must then be displayed to the user in a convenient and informative way. The gprof profiler accounts for the run- ning time of called routines in the running time of the routines that call them. The design and use of this profiler is described. 1. Programs to be Profiled Software research environments normally include many large programs both for production use and for experimental investigation. These programs are typically modular, in accordance with generally accepted principles of good program design. Often they consist of numerous small routines that implement various abstractions. Sometimes such large programs are written by one programmer who has understood the requirements for these abstractions, and has programmed them appropriately. More frequently the pro- gram has had multiple authors and has evolved over time, changing the demands placed on the implementa- tion of the abstractions without changing the implementation itself. Finally, the program may be assembled from a library of abstraction implementations unexamined by the programmer. Once a large program is executable, it is often desirable to increase its speed, especially if small por- tions of the program are found to dominate its execution time. The purpose of the gprof profiling tool is to help the user evaluate alternative implementations of abstractions. We dev eloped this tool in response to our efforts to improve a code generator we were writing (Graham82). The gprof design takes advantage of the fact that the programs to be measured are large, structured and hierarchical. We provide a profile in which the execution time for a set of routines that implement an abstraction is collected and charged to that abstraction. The profile can be used to compare and assess the costs of various implementations. The profiler can be linked into a program without special planning by the programmer. The overhead for using gprof is low; both in terms of added execution time and in the volume of profiling information recorded. 2. Types of Profiling There are several different uses for program profiles, and each may require different information from the profiles, or different presentation of the information. We distinguish two broad categories of pro- files: those that present counts of statement or routine invocations, and those that display timing informa- tion about statements or routines. Counts are typically presented in tabular form, often in parallel with a listing of the source code. Timing information could be similarly presented; but more than one measure of time might be associated with each statement or routine. For example, in the framework used by gprof 1
Journal: Sigplan Notices - SIGPLAN , pp. 120-126, 1982
Cumulative Annual
View Publication
The following links allow you to view full publications. These links are maintained by other sources not affiliated with Microsoft Academic Search.
Sort by: