Post-Link Optimization for Linux on POWER
A post-link optimization utility for the POWER architecture that optimizes an executable program or a shared library, based on its run-time profile.
Date Posted: June 30, 2004
|
|
 |
 |
|
 |  Post-Link Optimization for Linux® on POWER™ is also called FDPR-Pro (Feedback Directed Program Restructuring). FDPR-Pro is the main optimization tool. It can either instrument a program or, if given the program's profile, optimize it. FDPR is the wrapper script that runs FDPR-Pro through the instrumentation phase, then collects the profile (the training phase), and, finally, runs the optimization phase. | | |
 |  Follow the instructions in README.txt (see A2) and make sure the <installdir>/bin is in your command path. | | |
 |  The FDPR wrapper script runs the actual FDPR-Pro optimizer. Make sure the FDPR-Pro is in the command path. | | |
 |  These are the instrumentation shared libraries, provided in the installation. As the README.txt indicates, you must set the environment variable LD_LIBRARY_PATH to the directory containing them (or move them to the default shared library path). | | |
 |  FDPR-Pro requires that the input contain relocation information. This is achieved by specifying --emit-reloc (or -q) in in the link ("ld") command. If the link command is implicit in the compile command, add -Wl,-q to the (gcc) compile command. This passes the -q option to the linker. | | |
 |  First the program should be instrumented and its initial profile generated, as follows:
$ fdprpro -a instr myprog
The output will be generated (by default) in myprog.instr and its profile in myprog.nprof.
Next, run myprog.instr on some typical workload. This will fill the profile file with information that characterizes the workload.
Finally, re-run FDPR-Pro with the profile file provided, as follows:
$ fdprpro -a opt -f myprog.nprof [optimization options] myprog
Note that, given a script test, which runs the myprog.instr on a typical workload, all the above can be done in one command:
$ fdpr --instr --train test --opt [optimization options] myprog | | |
 |  Running of the instrumented program may fail for several reasons:
- It cannot find the instrumentation library libfdprinst*.so. Check that the environment variable LD_LIBRARY_PATH includes the directory where these libraries are located.
- It cannot find the profile file. It might be deleted or might not be not in its assumed location. Note that the location of the profile file is set in the instrumentation phase. By default, it is in the directory of the output file. In order to make sure that the instrumented program will find the profile file, you may set the environment variable FDPR_PROF_DIR to the directory containing the profile file.
- FDPR runs a script, the parameter of the --train option. If the script exits with a non-zero exit status, FDPR detects this as a failure. Make sure that if the training script terminates correctly, it exits with a zero status.
| | |
 |  Currently this feature is not supported.
| | |
 |  Yes. The optimized program is in a regular executable format and can be run by a Linux debugger. Symbolic information allows access to functions and data. However, currently the detailed debug information (that is, DWARF) is not updated, so, for example, mapping from program addresses to source lines is not possible.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
POWER is a trademark of IBM Corporation in the United States, other countries, or both.
Other company, product, or service names may be trademarks or service marks of others.
| |
|
|
 |
|
| |