qpt_stats(1) UNIX Programmer's Manual qpt_stats(1) NAME qpt2_stats - Produce Program Profiles for qpt2 SYNTAX qpt2_stats [-c file -f file -i file -Rd -Rh# -Rp# -Rs -v -Wd file -Wfb file] a.out DESCRIPTION qpt2 is an exact and efficient profiler profiler. When a profiled program executes, it writes a count file that records the execution frequency of all basic blocks (``slow'' mode) or an infrequently executed subset of the edges (``quick'' mode). qpt2_stats reads the count file and reports the number of instructions executed in a variety of formats. OPTIONS The following options control which information is reported. -Rd Report the dynamic execution frequency of classes of instructions. -Rs Report the static execution frequency of classes of instructions. -Rh# Print a hierarchical (gprof-like) count of the execution cost of the procedures in the program. # is an optional integer that specifies the instruction-count cutoff-threshold, below which a procedure is not reported. -Rp# Print a flat (prof-like) count of the execution cost of the procedures in the program. # is an optional integer that specifies the instruction- count cutoff-threshold, below which a procedure is not reported. The rest of the options specify the names of the input and output files: -c file Read counters from a file called ``file''. The default is to read a file whose name is formed by appending ``.QCounts'' to the name of the execut- able file, so the counts for ``myprog'' are read from ``myprog.QCounts''. -f file Use the feedback file called ``file'' produced by qpt2_stats to determine the locations of the counters. The default name is the program's name followed by ``.FB''. -Wd file Write the derived counts for each basic block from Printed 6/2/95 1 qpt_stats(1) UNIX Programmer's Manual qpt_stats(1) a quick profile to a file called ``file''. -Wfb file Write a feedback file that records the frequency of each edge in the program's control-flow graph. This information can be used to place counters more effectively in qpt. EXAMPLE In the following example, the program myprog is profiled while running on a small input data set. The profile is used to build a feedback file, which is used to profile the program again. qpt2 -q myprog myprog.qpt small_input qpt2_stats -Wfb myprog qpt2 -q -fb myprog myprog.qpt very_large_input BUGS Quick profiling may produce incorrect counts in programs that execute interprocedural jumps. setjmp/longjmp are interprocedural jumps. These jumps also occur in handwrit- ten code. An indication that this error happened is that qpt2_stats complains about negative edge counts. SEE ALSO qpt2(1), prof(1), gprof(1), pixie(1) Thomas Ball and James Larus, ``Optimally Profiling and Trac- ing Programs,'' ACM Transactions on Programming Languages and Systems (TOPLAS), pp. 1319--1360, July 1994. AUTHOR James R. Larus (larus@cs.wisc.edu), Computer Sciences Department, University of Wisconsin-Madison. Printed 6/2/95 2