CPROF Beta Test Version

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, psutera@us.ibm.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:

  1. dladdr support to find program objects inside DLLs (New feature in the 2004-03-15 patch)
  2. -f option to flag functions that exceed a certain threshold. (New feature in the 2004-03-15 patch)
  3. Files in our old patch that should never have been there.
  4. Our old patch "asked" questions of the user. That's bad.
  5. 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.
  6. Patch is run first prior to other cprof build steps, instead of in the middle of the build.
  7. Use automake to create the proper level of depcomp.
  8. Use libtoolize to generate config.guess, config.sub.
  9. 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.
  10. Repair the broken header line in the output of cprof (garbage in the header). Code from Dionne Graff fixed and retested.
  11. 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
automake --copy --add-missing
libtoolize --force --copy --automake
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.

Bug Reports

If you test with this patch, please send bug reports to Paul Sutera, psutera@us.ibm.com, with a courtesy copy to Scott Courtney, scourtney@sinenomine.net.

Usage Notes

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
cprof ./test1


Consult the Using CPROF Mini-HOWTO for more detailed information.