The gcompare Utility Program

The Green Hills gcompare Utility Program compares the code size of two input files and prints a report. An input file can be an ASCII text file, an object file, an object file library, or an executable file. If an input file is a text file, it consists of lines in the following format:

name1 number1
name2 number2
...

Each name/number pair is on its own line, separated by blanks or tabs.

If an input file is an object file, an object library file, or an executable file, gcompare automatically runs gfunsize -gcompare -all (or another command specified by the -x option) to produce a text file to compare.

You can mix all input file types with no restrictions, including files for different target CPUs.

The gcompare utility first reads both input files. For any name which does not exist in both files, gcompare prints a warning, unless -w is specified. For each name which exists in both files, gcompare compares the code size of the old and new numbers. If the old number is worse (larger is worse unless -i is specified) gcompare writes a line to the output report file containing the name, old number, new number, and percentage by which the new number is better.

For example:

main 32 28 -14%

Usage

To use gcompare, enter:

gcompare [options] oldfile newfile

where

options gcompare options, listed on the following page.

oldfile First input file.

newfile Second input file.

The gcompare options include:

-help Display information about all options.

-i Invert comparison. With -i, larger is better. Without -i, smaller is better.

-r Print a 2-column report, with comparisons sorted both from worst to best and from best to worst.

-l Print a report, with comparisons sorted from worst to best.

-L Format for 132 column landscape mode. Default is 80 column portrait mode.

-v Verbose mode. Print all comparisons. Without -v, only print comparisons for which newfile is worse than oldfile.

-w Suppress warnings.

-x cmd Specify the command to execute on a non-ASCII input file. The default -x command is:

-x "gfunsize -gcompare -all"

-z Do not show cases where files are the same.

If the -r, -l, or -v options are used, all comparisons are shown, regardless of the result of the comparison. With -r, two reports are shown side by side in two columns. The left column is sorted best first, and the right column is sorted worst first.

Sample -r output:
linpack.188.O.s vs linpack.188.OS.a linpack.188.OS.a vs linpack.188.O.a
WORSE by:
4172
3746
11%
BETTER by:
3726
4172
10%
linpack.o:_daxpy
152
112
-36%
linpack.o:_dscal
34
34
0%
linpack.o:_matgen
342
258
-33%
linpack.o:_epslon
20
20
0%
linpack.o:_dgesl
294
240
-23%
linpack.o:_idamax
72
72
0%
linpack.o:_dgefa
524
442
-19%
linpack.o:_dmxpy
1516
1598
5%
linpack.o_main
1136
1052
-8%
linpack.o:_main
1052
1136
7%
linpack.o:_dmxpy
1598
1516
-5%
linpack.o:_dgefa
442
524
16%
linpack.o:_idamax
72
72
0%
linpack.o:_dgesl
240
294
18%
linpack.o:_epslon
20
20
0%
linpack.o:_matgen
258
342
25%
linpack.o:_dscal
34
34
0%
linpack.o:_daxpy
112
152
26%

The output, especially in -r mode, can require many columns. The -L option formats the gcompare output for 132 columns instead of the default 80 columns. On a UNIX system, use the command lpr -L to print the resulting report in landscape mode.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.