IBM Power7 Optimization And Tuning Manual page 134

Table of Contents

Advertisement

Profiling shared libraries
When the dynamic linker searches for and links a shared library during execution, it looks for
the original name that is used to the command used for linking the program. To ensure that
the instrumented library is run, ensure that the following items are true:
1. The instrumented library should have the same name as the original library. The user can
rename the original or place the libraries in different folders.
2. The folder that contains the library must be in the library search path: LIBPATH on AIX and
LD_LIBRARY_PATH on Linux.
Moving and renaming the profile file
The location of the profile file is specified in the instrumented program, as indicated by the -f
option. However, the profile file might be moved, or if its original specification is relative, the
real location can change before execution.
Use the -fdir option to set the profile directory if it is known at instrumentation time and is
different from the one implied or specified by the -f option.
Use the FDPR_PROF_DIR environment variable to specify the profile directory if the profile file is
not present in the relative or absolute location where it was created in the instrumentation
step (or where specified originally by -fdir).
Use the FDPR_PROF_NAME environment variable to specify the profile file name if the profile file
name changed.
Profile file descriptor
When the instrumented binary file is run, the profile file is mapped to shared memory. The
process is using a default file descriptor (FD) number (1023 on Linux and 1999 on AIX) for the
mapping. If the application uses this specific FD, an error can occur during the profiling phase
because of this conflict of use. Use the -fd option to change the default FD used by FDPR:
$ fdprpro -a instr my_prog -fd <
The FD can also be controlled by using the FDPR_PROF_FD environment variable by changing
the FD at run time:
$ export FDPR_PROF_FD=
FDPR can be used to profile several binary executable files in a single run of an application. If
so, you must specify a different FD for each binary. For example:
$ fdprpro -a instr in/libmy_lib1 -o out/libmy_lib1 -f out/libmy_lib1.prof -fd
1023
$ fdprpro -a instr in/libmy_lib2 -o out/libmy_lib2 -f out/libmy_lib2.prof -fd
1022
Because environment variables are global in nature, when profiling several binary files at the
same time, use explicit instrumentation options (-f, -fd, and -fdir) to differentiate between
the profiles rather than using the environment variables (FDPR_PROF_FD and FDPR_PROF_NAME).
118
POWER7 and POWER7+ Optimization and Tuning Guide
fd num
>
fd_num

Advertisement

Table of Contents
loading

This manual is also suitable for:

Power7+

Table of Contents