>>-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:
PROGRAM P
CALL HelloWorld()
CONTAINS
SUBROUTINE HelloWorld()
PRINT *, "Hello World"
END SUBROUTINE HelloWorld
END PROGRAM P
END
xlf2008 -qpdf1 -O hello.f
showpdf
The result is as follows:
...
-----------------------------------
p(63): 1 (hello.f)
Call Counters:
2 | 1 @2@helloworld(64)
2 | 1 _xlfExit(65)
Call coverage = 100% ( 2/2 )
Block Counters:
1-10 | 1
10 |
Block coverage = 100% ( 1/1 )
-----------------------------------
@2@helloworld(64): 1 (hello.f)
Call Counters:
7 | 1 _xlfBeginIO(66)
7 | 1 _xlfWriteLDChar(67)
7 | 1 _xlfEndIO(68)
Call coverage = 100% ( 3/3 )
Block Counters:
6-7 | 1
8 |
8 | 1
Block coverage = 100% ( 2/2 )
-----------------------------------
_xlfExit(65): 1 undefined node
-----------------------------------
_xlfBeginIO(66): 1 undefined node
-----------------------------------
_xlfWriteLDChar(67): 1 undefined node
-----------------------------------
_xlfEndIO(68): 1 undefined node
Total Call coverage = 100% ( 5/5 )
Total Block coverage = 100% ( 3/3 )
showpdf -xml
The result is as follows:
<?xml version="1.0" encoding="UTF-8" ?>
- <XLTransformationReport xmlns="http://www.ibm.com/2010/04/CompilerTransformation" version="1.0">
- <CompilationStep name="showpdf">
<StepDetails>
...
<Detail>
<FieldTitle>Total Call coverage</FieldTitle>
<FieldValue>100% ( 5/5 )</FieldValue>
</Detail>
<Detail>
<FieldTitle>Total Block coverage</FieldTitle>
<FieldValue>100% ( 3/3 )</FieldValue>
</Detail>
</StepDetails>
<ProgramHierarchy>
<FileList>
<File id="1" name="hello.f">
<RegionList>
<Region id="63" name="p" startLineNumber="1"/>
<Region id="64" name="@2@helloworld" startLineNumber="6"/>
</RegionList>
</File>
</FileList>
</ProgramHierarchy>
<TransformationHierarchy/>
<ProfilingReports>
<BlockCounterList>
<BlockCounter regionId="63" execCount="1" coveredBlock="1" totalBlock="1">
<BlockList>
<Block index="3" execCount="1" startLineNumber="1" endLineNumber="10"/>
</BlockList>
</BlockCounter>
<BlockCounter regionId="64" execCount="1" coveredBlock="2" totalBlock="2">
<BlockList>
<Block index="3" execCount="1" startLineNumber="6" endLineNumber="7"/>
<Block index="4" execCount="1" startLineNumber="8" endLineNumber="8"/>
</BlockList>
</BlockCounter>
</BlockCounterList>
<CallCounterList>
<CallCounter regionId="63" execCount="1" coveredCall="2" totalCall="2">
<CallList>
<Call name="@2@helloworld" execCount="1" lineNumber="2"/>
<Call name="_xlfExit" execCount="1" lineNumber="2"/>
</CallList>
</CallCounter>
<CallCounter regionId="64" execCount="1" coveredCall="3" totalCall="3">
<CallList>
<Call name="_xlfBeginIO" execCount="1" lineNumber="7"/>
<Call name="_xlfWriteLDChar" execCount="1" lineNumber="7"/>
<Call name="_xlfEndIO" execCount="1" lineNumber="7"/>
</CallList>
</CallCounter>
</CallCounterList>
</ProfilingReports>
</CompilationStep>
</XLTransformationReport>