A listing is a compiler output file (with a .lst suffix) that contains
information about a particular compilation. As a debugging aid, a
compiler listing is useful for determining what has gone wrong in
a compilation. For example, any diagnostic messages emitted during
compilation are written to the listing.
To produce a listing, you can compile with any of the following
options, which provide different types of information:
When any of these options is in effect, a listing file
filename.lst
is saved in the current directory for every input file named in the
compilation.
Listing information is organized in sections. A listing contains
a header section and a combination of other sections, depending on
other options in effect. The contents of these sections are described
as follows.
- Header section
- Lists the compiler name, version, release, the source
file name, and the date and time of the compilation.
- Source section
- If you use the -qsource option, lists the input
source code with line numbers. If there is an error at a line, the
associated error message appears after the source line. Lines containing
macros have additional lines showing the macro expansion. By default,
this section only lists the main source file. Use the -qshowinc option
to expand all header files as well.
- Options section
- Lists the non-default options that were in effect during
the compilation. To list all options in effect, specify the -qlistopt option.
- Attribute and cross-reference listing section
- If you use the -qattr or -qxref options,
provides information about the variables used in the compilation unit,
such as type, storage duration, scope, and where they are defined
and referenced. Each of these options provides different information
on the identifiers used in the compilation.
- File table section
- Lists the file name and number for each main source file and include
file. Each file is associated with a file number, starting with the
main source file, which is assigned file number 0. For each file,
the listing shows from which file and line the file was included.
If the -qshowinc option is also in effect, each
source line in the source section will have a file number to indicate
which file the line came from.
- PDF report section
- The following information is included in this section when you
use the -qreport option with the -qpdf2 option:
- Loop iteration count
- The most frequent loop iteration count and the average iteration
count, for a given set of input data, are calculated for most loops
in a program. This information is only available when the program
is compiled at optimization level -O5.
- Block and call count
- This section of the report covers the Call Structure of
the program and the respective execution count for each called function.
It also includes Block information for each function. For non-user
defined functions, only execution count is given. The Total Block
and Call Coverage, and a list of the user functions ordered by decreasing
execution count are printed in the end of this report section. In
addition, the Block count information is printed at the beginning
of each block of the pseudo-code in the listing files.
- Cache miss
- This section of the report is printed in a single table. It reports
the number of Cache Misses for certain functions, with additional
information about the functions such as: Cache Level , Cache
Miss Ratio, Line Number, File Name,
and Memory Reference.
Note: You must use the option -qpdf1=level=2 to
get this report.
You can also select the level of cache to profile
using the environment variable PDF_PM_EVENT during
run time.
- Transformation report section
- If the -qreport option is in effect, this section
displays pseudo code that corresponds to the original source code,
so that you can see parallelization and loop transformations that
the -qhot or -qsmp option has
generated. This section of the report will also show
additional loop transformation and parallelization information on
loop nests if you compile with -qsmp and -qhot=level=2.
This
section also reports the number of streams created for a given loop
and the location of data prefetch instructions inserted by the compiler.
To generate information about data prefetch insertion locations, use
the optimization level of -qhot, -O3 -qhot, -O4 or -O5 together
with -qreport.
- Data reorganization section
- Displays data reorganization messages for program variable data
during the IPA link pass when -qreport is used
with -qipa=level=2 or -O5. Reorganization
information includes:
- array splitting
- array transposing
- memory allocation merging
- array interleaving
- array coalescing
- Compilation epilogue section
- Displays a summary of the diagnostic messages by severity level,
the number of source lines read, and whether or not the compilation
was successful.
- Object section
- If you use the -qlist option, lists the object code generated by the compiler. This section is useful for diagnosing
execution time problems, if you suspect the program is not performing
as expected due to code generation error.