C programmer's productivity tools

Merging option

As described in the section ``The PROFOPTS environment variable'' data files can be merged automatically at run-time. You can also merge existing data files using the lprof command, as illustrated in the following example:

   $ lprof -d destfile -m file1.cnt file2.cnt file3.cnt
The -d option is followed by the name of the file that will contain the merged data. The -m option is followed by the names of two or more data files to be merged. The data files must have been created by the same profiled program; if they have not, lprof will issue an error message:
   $ lprof -d merged.cnt -m prog1.cnt prog2.cnt
   ERROR: 'prog1', 'prog2'
      Object file entry names & timestamps don't match.
   *** no merged output ***
You may have multiple data files created by the same program that have different time stamps. This will happen, for example, if you recompile a program. If you want to merge data from runs of different versions of the same program, you can override the time-stamp check by specifying -T (time stamp override).

NOTE: You must be extremely cautious when using the -T option. If the control flow of the recompiled program has changed, the new merged data file is very likely to be erroneous, and lprof will produce an incorrect report.

Next topic: Cautionary notes on using lprof
Previous topic: Summary option

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003