|
ABSTRACT
This paper describes algorithms for inserting monitoring code to profile and trace programs. These algorithms greatly reduce the cost of measuring programs with respect to the commonly used technique of placing code in each basic block. Program profiling counts the number of times each basic block in a program executes. Instruction tracing records the sequence of basic blocks traversed in a program execution. The algorithms optimize the placement of counting/tracing code with respect to the expected or measured frequency of each block or edge in a program's control-flow graph. We have implemented the algorithms in a profiling/tracing tool, and they substantially reduce the overhead of profiling and tracing.We also define and study the hierarchy of profiling problems. These problems have two dimensions: what is profiled (i.e., vertices (basic blocks) or edges in a control-flow graph) and where the instrumentation code is placed (in blocks or along edges). We compare the optimal solutions to the profiling problems and describe a new profiling problem: basic-block profiling with edge counters. This problem is important because an optimal solution to any other profiling problem (for a given control-flow graph) is never better than an optimal solution to this problem. Unfortunately, finding an optimal placement of edge counters for vertex profiling appears to be a hard problem in general. However, our work shows that edge profiling with edge counters works well in practice because it is simple and efficient and finds optimal counter placements in most cases. Furthermore, it yields more information than a vertex profile. Tracing also benefits from placing instrumentation code along edges rather than on vertices.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Alfred V. Aho , Ravi Sethi , Jeffrey D. Ullman, Compilers: principles, techniques, and tools, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, 1986
|
 |
2
|
|
 |
3
|
|
 |
4
|
|
 |
5
|
Robert F. Cmelik , Shing I. Kong , David R. Ditzel , Edmund J. Kelly, An analysis of MIPS and SPARC instruction set utilization on the SPEC benchmarks, Proceedings of the fourth international conference on Architectural support for programming languages and operating systems, p.290-302, April 08-11, 1991, Santa Clara, California, United States
|
 |
6
|
Joseph A. Fisher , John R. Ellis , John C. Ruttenberg , Alexandru Nicolau, Parallel processing: a smart compiler and a dumb machine, Proceedings of the 1984 SIGPLAN symposium on Compiler construction, p.37-47, June 17-22, 1984, Montreal, Canada
|
| |
7
|
|
| |
8
|
|
| |
9
|
GOLDBERG, A. 1991. Reducing overhead in counter-based execution profiling. Tech. Rep. CSL-TR- 91-495, Computer Systems Lab., Stanford Univ., Stanford, Calif., Oct.
|
| |
10
|
|
| |
11
|
GRAHAM, S. L., KESSLER, P. B., AND MCKUSICK, M. K. 1983. An execution profiler for modular programs. Softw. Pratt. Exper. 13, 671-685.
|
| |
12
|
|
| |
13
|
|
| |
14
|
|
| |
15
|
KNUTH, D. E., AND STEVENSON, F, R, 1973. Optimal measurement points for program fre-quency counts. BIT 13, 313-322.
|
| |
16
|
|
| |
17
|
|
| |
18
|
|
| |
19
|
MAHESHWARI, S. 1976. Traversal marker placement problems are NP-complete. Rep. CU-CS-092- 76, Dept. of Computer Science, Univ of Colorado, Boulder, Colo.
|
 |
20
|
|
| |
21
|
MENDOZA, K., ED 1989. Systems performance evaluation cooperative. SPEC Newsl. 1, 1 (Fall).
|
| |
22
|
MIPS COMPUTERSYSTEMS. 1990. UMIPS-V Reference Manual (pixie and pixstats). MIPS Com-puter Systems, Sunnyvale, Calif.
|
 |
23
|
|
 |
24
|
|
| |
25
|
PROBERT, R. L. 1975. Optimal insertion of software probes in well-dehmited programs. IEEE Trans. Softa,. Eng. SE-8, 1(Jan.), 34-42
|
| |
26
|
RAMAMOORTHY, C. V., KIM, K. H., AND CHEN, W. T. 1975 Optimal placement of software monitors aiding systematic testing, IEEE Trans. Softw. Eng. SE-1, 4 (Dec.), 403 -410.
|
 |
27
|
|
| |
28
|
|
 |
29
|
|
 |
30
|
|
| |
31
|
|
 |
32
|
|
CITED BY 70
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Jennifer M. Anderson , Lance M. Berc , Jeffrey Dean , Sanjay Ghemawat , Monika R. Henzinger , Shun-Tak A. Leung , Richard L. Sites , Mark T. Vandevoorde , Carl A. Waldspurger , William E. Weihl, Continuous profiling: where have all the cycles gone?, ACM SIGOPS Operating Systems Review, v.31 n.5, p.1-14, Dec. 1997
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Thomas Ball , Peter Mataga , Mooly Sagiv, Edge profiling versus path profiling: the showdown, Proceedings of the 25th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.134-148, January 19-21, 1998, San Diego, California, United States
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Jennifer M. Anderson , Lance M. Berc , Jeffrey Dean , Sanjay Ghemawat , Monika R. Henzinger , Shun-Tak A. Leung , Richard L. Sites , Mark T. Vandevoorde , Carl A. Waldspurger , William E. Weihl, Continuous profiling: where have all the cycles gone?, ACM Transactions on Computer Systems (TOCS), v.15 n.4, p.357-390, Nov. 1997
|
|
|
|
|
|
|
|
|
|
|
|
Olaf Lüthje , Martin Coors , Holger Keding , Heinrich Meyr, A novel approach to code analysis of digital signal processing systems, Proceedings of the 2001 international conference on Compilers, architecture, and synthesis for embedded systems, November 16-17, 2001, Atlanta, Georgia, USA
|
|
|
|
|
|
|
|
|
Jyh-Herng Chow , Yong-fong Lee , Kalyan Muthukumar , Vivek Sarkar , Mauricio Serrano , Iris Garcia , John Hsu , Shauchi Ong , Honesty Young, Optimized code restructuring of OS/2 executables, Proceedings of the 1995 conference of the Centre for Advanced Studies on Collaborative research, p.12, November 07-09, 1995, Toronto, Ontario, Canada
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
W. J. Schmidt , R. R. Roediger , C. S. Mestad , B. Mendelson , I. Shavit-Lottem , V. Bortnikov-Sitnitsky, Profile-directed restructuring of operating system code, IBM Systems Journal, v.37 n.2, p.270-297, April 1998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
REVIEW
"Paul W. Abrahams : Reviewer"
Ball and Larus describe algorithms they developed for profiling and
tracing programs. The components to be analyzed can be either the
vertices of the program graph or its edges. The profile counts for the
vertices can be deduced from those for
more...
|