Code Profiling Utilities Manual
Code Profiling Usage Scenarios
HP Code Profiling Utilities Manual—542684-003
9-5
Build the Instrumented Application
Build the Instrumented Application
Following is the output of a files command, showing the contents of a subvolume that
so far contains only the source code (which have names ending in C) and required
header files (which have names ending in H) for the elfdump application.
The following commands invoke the C++ compiler and linker to build the instrumented
version of elfdump.
In this example, the application consists of three separate source files, requiring three
separate compilations. The profgen option is used in each compilation, and the -lpgo
option is added to the linker step.
The following display shows the contents of the subvolume after the build.
The elfdump executable, ELFDUMP, contains the instrumentation necessary to create
a raw data file.
Run the Instrumented Application
In the preceding display, note that there are no files whose names begin with ZZPF in
the current subvolume. If there were, it would be necessary to purge or move them so
they would not cause confusion in this run.
$DATA05.TEST 2> files
$DATA05.TEST
ELFCOMH ELFDUMPC NSKELFH PLATDEPC YOSELFC YOSELFH
cppcomp /in elfdumpc, out elfdumpl/ elfdumpo; profgen
cppcomp /in platdepc, out platdepl/ platdepo; profgen
cppcomp /in yoselfc, out yoselfl/ yoselfo; profgen
eld /out linkout/ $system.system.ccplmain elfdumpo platdepo
yoselfo -lcrtl -lcre -lpgo -o elfdump
$DATA05.TEST 5> files
$DATA05.TEST
ELFCOMH ELFDUMP ELFDUMPC ELFDUMPL ELFDUMPO LINKOUT
NSKELFH PLATDEPC PLATDEPH PLATDEPL PLATDEPO YOSELFC
YOSELFH YOSELFL YOSELFO










