DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
C compilation system

Preparing your program for profiling

To use either of the profilers that are supplied with the C compilation system, you must do two things:

  1. Compile and link your program with a profiling option:

    for prof: cc -qp test.c
    for lprof: cc -ql test.c

  2. Run the profiled program:
    $ a.out
    
At the end of execution, data about your program's run-time behavior is written to a file in your current directory:

for prof: mon.out
for lprof: prog.cnt

where prog is the name of the profiled program. The data files are inputs to the profilers. See ``lprof'' and ``Interpreting profiling output'' in ``C programmer's productivity tools'' for further information.


Next topic: Optimizing your program
Previous topic: Preparing your program for debugging

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003