Code Profiling Utilities Manual

Code Profiling Usage Scenarios
HP Code Profiling Utilities Manual542684-003
9-9
Build the Application
header files (which have names ending in H). The application will be built and
executed in the Guardian environment.
2. The following command lines invoke the compiler and linker with options related to
code coverage. The codecov option causes the compiler to create an
instrumented object file. The generated SPI file will have the name PGOSPI. The -
lpgo
option is required to link instrumented object files.
3. The following display shows the build directory after the build. Notice the new
instrumented object files (which have names ending in O), the SPI file PGOSPI,
and the lock file PGOSPL
$DATA05.TEST 2> files
$DATA05.TEST
ELFCOMH ELFDUMPC NSKELFH PLATDEPC PLATDEPH YOSELFC
YOSELFH
cppcomp /in elfdumpc, out elfdumpl/ elfdumpo; codecov
cppcomp /in platdepc, out platdepl/ platdepo; codecov
cppcomp /in yoselfc, out yoselfl/ yoselfo; codecov
eld /out linkout/ $system.system.ccplmain elfdumpo platdepo
yoselfo -lcrtl -lcre -lpgo -o elfdump
Note. The lock file PGOSPL is created by the compiler to ensure that concurrent compilations
do not attempt to read or write to the SPI file at the same time; access to the SPI file must be
synchronized.
$DATA05.TEST
ELFCOMH ELFDUMP ELFDUMPC ELFDUMPL ELFDUMPO LINKOUT
NSKELFH PGOSPI PGOSPL PLATDEPC PLATDEPH PLATDEPL
PLATDEPO YOSELFC YOSELFH YOSELFL YOSELFO