Paul Sutera of IBM Corporation, a colleague of Theresa Halloran at IBM's Poughkeepsie, N.Y. development labs, has submitted an extensive patch for the cprof profiling tool. The patch has been tested on the following platforms:
- S/390 Linux under SuSE SLES 7
- S/390 Linux under SuSE SLES 8
- Intel Linux under SuSE SLES 7
- Intel Linux under SuSE SLES 8
For the S/390 (zSeries) platform, both 32-bit and 64-bit processors were tested.
Although the patch has been extensively tested, it is still considered to be a beta level release at this time. Developers are requested to download and test this patch, and to report any bugs (or favorable test results) to Paul Sutera, email@example.com.
If you do not wish to beta test the new patch, please use the stable version instead.
Problems Fixed in this Patch
The patch is intended to correct the following problems in cprof. As of the date of the patch, this list includes all outstanding bugs that were known to the patch developer:
- dladdr support to find program objects inside DLLs (New feature in the 2004-03-15 patch)
option to flag functions that exceed a certain threshold. (New feature in the 2004-03-15 patch)
- Files in our old patch that should never have been there.
- Our old patch "asked" questions of the user. That's bad.
- gcc 3.x under Linux is an ISO C++ compiler. The cprof C++ code is not ISO-compliant. SLES8 Linux systems use this newer gcc compiler, and compilation was completely broken under the new compiler. I made a number of changes to the source code to allow for compilation under gcc 3.x. Without these changes, cprof will not build under SLES8.
- Patch is run first prior to other cprof build steps, instead of in the middle of the build.
- Use automake to create the proper level of depcomp.
- Use libtoolize to generate config.guess, config.sub.
- Problems with later versions of automake and aclocal meant that cprof was not upward compatible with automake 1.6 and higher. Files (like configure.in) were changed to work on all automake versions.
- Repair the broken header line in the output of cprof (garbage in the header). Code from Dionne Graff fixed and retested.
- Add the ability of cprof to profile functions that reside in shared libraries. Code from Dionne Graff, exhaustive retest.
This patch completely replaces the previous patch from 2002-03-15.
Installing the March 15 Patch
You will need to start with a freshly-extracted copy of the source tarball for cprof version 1.0.1. Do not use source that was modified by the 2002-03-15 patch or the 2003-05-12 patch.
Place the patch file (cprof-20040315-beta.patch.gz) and the source code tarball (cprof-1.0.1.tar.gz) into the same directory (generally /usr/local/src/) on your system. Then perform the following steps to apply the patch to cprof source code:
tar -zxvf cprof-1.0.1.tar.gz cd cprof-1.0.1 zcat ../cprof-20040315-beta.patch.gz | patch -p1 aclocal automake --copy --add-missing autoconf libtoolize --force --copy --automake ./configure make su -c make install
NOTE: Some browsers, such as Microsoft Internet Explorer, may pre-unzip the patch file as they download it. If your browser does this, save the file as cprof-20040315-beta.patch, and modify the zcat step above so that "cat" is used instead of "zcat" and so that the filename is correct for you. Alternatively, when you click on the link to download the patch, use SHIFT on your keyboard along with the mouse button. In most cases, this will suppress the browser's change of filetype.
Dionne Graff of IBM was kind enough to point out that, when running the test cases, you must first execute the test program without CPROF, then use CPROF to profile it. For example,
cd test ./test1 cprof ./test1
Consult the Using CPROF Mini-HOWTO for more detailed information.