i960 Processor Compiler User's Guide
4-12
4
Building an Instrumented Program
You can create a profile-instrumented program either of two ways:
compile source modules with the
-fprof option, or link object modules
using a
-gcdm,subst=+fprof substitution.
• When compiling with
-fprof, the object files generated in your
working directory contain profile-instrumented code.
• When compiling with
-gcdm,subst=+fprof, the profile-
instrumented object files reside in the PDB, not in your work space.
These approaches both yield the same instrumented version of
prog.
However, compiling with the
fprof option creates object modules useful
only for collecting a profile. If you compile with the
fprof option and do
not want a profile, you must then use substitutions to replace every
instrumented module in
prog, or you must recompile the modules without
the
fprof option.
Linking Using an +fprof Substitution
The example makefile requires no changes to accommodate this method;
just use:
make SUBST=fprof
No files are recompiled unless source files have changed; only the
following link command is issued:
ic960 -o prog -Ttarg -fdb -gcdm,subst=*:*+fprof,iprof=
fee.o foo.o
This command causes substitution modules with profile instrumentation to
be compiled in the PDB to replace the original modules
fee.o and foo.o
in the linked program prog.
NOTE. Profiles collected with +fprof substitutions must be made into
self-contained profiles before linking.