QPT:
A Quick Program Profiling and Tracing System

QPT is an exact and efficient program profiler and tracing system. It rewrites a program's executable file (a.out) by inserting code to record the execution frequency or sequence of every basic block (straight-line sequence of instructions) or control-flow edge. From this information, another program QPT_STATS can calculate the execution cost of procedures in the program. Unlike the Unix tools PROF and GPROF, QPT records exact execution frequency, not a statistical sample. When tracing a program, QPT produces a trace regeneration program that reads the highly compressed trace file and regenerates a full program trace.

When profiling, QPT operates in two modes. In "slow" mode, it places a counter in each basic block in a program--in the same manner as the MIPS tool PIXIE. In "quick" mode, QPT places counters on an infrequently-executed subset of the edges in the program's control-flow graph. This placement can reduce the cost of profiling by 3--4 times. Since there is no such thing as a free lunch, quick profiling requires more program analysis and consequently slows QPT and QPT_STATS. The additional cost to instrument a program and report results, however, is small and is quickly gained back when profiling long-running programs.

Like other systems such as pixie, QPT can rewrite an executable file to record the sequence of instruction and data references. However, QPT uses abstract execution to reduces the overhead of tracing to 2--6 times a program's untraced execution cost. QPT also records a number of semantics events--such as loop entry and iteration, function entry and exit, and memory allocation and deallocation--that other systems do not identify.

The original version of this program, QPT, is obsolete and has not been maintained for several years. At that time, it ran under DEC's Ultrix on a DECStation (MIPS processor) and Sun's SunOS 4.1.2 on a SPARCstation.

QPT2, the new version of QPT, is build on EEL, a library for editing executable files. EEL currently runs on SPARC-based machines (SunOS and Solaris). The machine-specific code in EEL and QPT2 is collected in a few files. Porting to a new machine requires a couple months of effort.

Documentation

Applications

David Wood has develop a cache profiler called cprof that uses traces from QPT to report the cache misses caused by statements in a program. CPROF is available as part of WARTS.

Obtaining QPT

QPT is distributed with EEL, which is available as part of WARTS.

QPT and QPT2 are distributed with the full source and a small amount of documentation. QPT and QPT2 are copyrighted by me and is distributed under the terms of the WARTS license. A copy of the license is available on ftp.cs.wisc.edu in ~ftp/pub/warts/license.ps, or can be obtained by contacting me at the address below.

James Larus
Computer Sciences Department
1210 West Dayton Street
University of Wisconsin
Madison, WI 53706

larus@cs.wisc.edu
(608) 262-9519


Last modified: March 1, 1999 by James Larus
larus@cs.wisc.edu