Profiling Your Program - Intel i960 User Manual

Processor compiler
Hide thumbs Also See for i960:
Table of Contents

Advertisement

4
Program-wide Analysis and Optimization
NOTE. The optimized replacements for
and
are present in
fee.o
foo.o
the linked program but never appear in the current working directory.

Profiling Your Program

Compiling for Profile Instrumentation with -fprof
As mentioned above, information on the runtime behavior of the program
can be used by the compilation system during the global decision making
and optimization step. To instrument a program, use the
option in
fprof
addition to
when compiling:
fdb
ic960 -Yd,mypdb -fdb -fprof -c foo.c
See Chapters 2 and 3 for more on the
option. This command causes
fprof
profile instrumentation to be inserted into
so that when the linked
foo.o
program is executed, a profile can be collected. Using runtime profiles to
influence the final optimization of your program requires you to build the
program twice: once to insert the instrumentation, as described here, and
then again so that the compilation system can substitute modules that are
recompiled with optimizations appropriate to their runtime behavior.
Collecting a Profile
If a program that contains one or more modules compiled with
is
fprof
linked with the standard libraries and then executed, a file named
containing the profile for those modules is automatically
default.pf
produced when the program exits. This is a "raw" profile containing
program counters that log how many times various statements in the
source program have been executed.
If you are not using the standard libraries, you must insert a call to a
routine that creates the profile in an appropriate point in the program
source code. For instructions on this step, see the section titled Runtime
Support for Profile Collection (page 4-15).
4-5

Advertisement

Table of Contents
loading

Table of Contents