>>-showpdf--+--------+--+--------------+--+----------------+--+-------+->< '-pdfdir-' '- -f--pdfname-' '- -m--pdfmapdir-' '- -xml-'
A PDF map file that contains static information is generated during the -qpdf1 phase, and a PDF file is generated during the execution of the resulting application. The showpdf utility needs both the PDF and PDF map files to display PDF information in either text or XML format.
If the -qpdf1=level=2 option is specified during the -qpdf1 phase, several PDF and PDF map files might be generated. Then if you want to view the profiling information, you need to run the showpdf utility for each pair of PDF and PDF map files.
By default, the PDF file is named ._pdf, and the PDF map file is named ._pdf_map. If the PDFDIR environment variable is set, the compiler places the PDF and PDF map files in the directory specified by PDFDIR. Otherwise, if the PDFDIR environment variable is not set, the compiler places these files in the current working directory. If the PDFDIR environment variable is set but the specified directory does not exist, the compiler issues a warning message. To override the defaults, use the -qpdf1=pdfname option to specify the paths and names for the PDF and PDF map files. For example, if you specify the -qpdf1=pdfname=/home/joe/func option, the resulting PDF file is named func, and the PDF map file is named func_map. Both of the files are placed in the /home/joe directory.
If the PDFDIR environment variable is changed between the -qpdf1 phase and the execution of the resulting application, the PDF and PDF map files are generated in separate directories. In this case, you must specify the directories for both of these files to the showpdf utility.
The following example shows how to use the showpdf utility to view the profiling information for a Hello World application:
#include <stdio.h>
void HelloWorld()
{
printf("Hello World");
}
main()
{
HelloWorld();
return 0;
}
xlc -qpdf1 -O hello.c
showpdf
HelloWorld(67): 1 (hello.c)
Call Counters:
4 | 1 printf(69)
Call coverage = 100% ( 1/1 )
Block Counters:
2-4 | 1
5 |
5 | 1
Block coverage = 100% ( 2/2 )
-----------------------------------
main(68): 1 (hello.c)
Call Counters:
8 | 1 HelloWorld(67)
Call coverage = 100% ( 1/1 )
Block Counters:
6-9 | 1
10 |
Block coverage = 100% ( 1/1 )
Total Call coverage = 100% ( 2/2 )
Total Block coverage = 100% ( 3/3 )
showpdf -xml
<?xml version="1.0" encoding="UTF-8" ?>
- <XLTransformationReport xmlns="http://www.ibm.com/2010/04/CompilerTransformation" version="1.0">
- <CompilationStep name="showpdf">
- <ProgramHierarchy>
- <FileList>
- <File id="1" name="hello.c">
- <RegionList>
<Region id="67" name="HelloWorld" startLineNumber="2" />
<Region id="68" name="main" startLineNumber="6" />
</RegionList>
</File>
</FileList>
</ProgramHierarchy>
<TransformationHierarchy />
- <ProfilingReports>
- <BlockCounterList>
- <BlockCounter regionId="67" execCount="1" coveredBlock="2" totalBlock="2">
- <BlockList>
<Block index="3" execCount="1" startLineNumber="2" endLineNumber="4" />
<Block index="2" execCount="0" startLineNumber="5" endLineNumber="5" />
<Block index="4" execCount="1" startLineNumber="5" endLineNumber="5" />
</BlockList>
</BlockCounter>
- <BlockCounter regionId="68" execCount="1" coveredBlock="1" totalBlock="1">
- <BlockList>
<Block index="3" execCount="1" startLineNumber="6" endLineNumber="9" />
<Block index="2" execCount="0" startLineNumber="10" endLineNumber="10" />
</BlockList>
</BlockCounter>
</BlockCounterList>
- <CallCounterList>
- <CallCounter regionId="67" execCount="1" coveredCall="0" totalCall="0">
- <CallList>
<Call name="printf" execCount="1" lineNumber="4" />
</CallList>
</CallCounter>
- <CallCounter regionId="68" execCount="1" coveredCall="0" totalCall="0">
- <CallList>
<Call name="HelloWorld" execCount="1" lineNumber="8" />
</CallList>
</CallCounter>
</CallCounterList>
<ValueProfileList />
<CacheMissList />
</ProfilingReports>
</CompilationStep>
</XLTransformationReport>