![]() | Editor | Infomgr | ![]() |
GNT Analyzer is a stand-alone tool for creating a statistical execution profile when a program, or suite of programs, is being tested or run. It provides execution profiles of programs compiled with the COBOL Compiler. They can be run several times against different test data, accumulating statistics each time they are run.
Analyzing your programs enables you to identify those statements in your COBOL program that have not been executed in a series of test runs as well as those areas of code which are most often executed. With this information you can pinpoint areas of code which would most benefit from further testing or program optimization.
GNT Analyzer works on callable shared objects (.so files), .int files, .gnt files, and system executable formats.
GNT Analyzer runs only in batch mode, so you can only see the finished analysis. However, since the application runs at almost full speed, you get the results of the analysis more quickly.
Figure 8-1 illustrates how GNT Analyzer provide program statistics.
Figure 8-1: GNT Analyzer
The following sections describe how to invoke and use GNT Analyzer.
This section describes how to prepare your program for analysis by GNT Analyzer and how to invoke the GNT Analyzer. The way in which the GNT Analyzer works is controlled by setting directives on the command line, and by the settings in a configuration file.
The basic steps in performing GNT analysis on your code are listed below.
More detailed information about these steps is provided in the remainder of this chapter.
The first step in the analysis is to compile your program using the GNTANLZ directive. This directive takes the form:
GNTANLZ=parameter
where parameter
is:
TICK | Causes a bit to be set for each basic block executed. |
COUNT | Counts how often each basic block is executed. |
A basic block is a block of contiguous statements with no jumps. For example, a set of MOVE statements could be referred to as a basic block.
Compiling your program with the GNTANLZ directive inserts special code into the program you are compiling so that the coverage statistics can be collected.
See the chapter Using the Compiler in your Server Express User Guide for details of how to set Compiler directives.
After you have tested your program using GNT Analyzer, a GNL file is produced. This file holds the results of the test. The following information is displayed for each program at the end of the test:
If you need to reset any counters when you run GNT Analyzer, you should remove the .gnl file.
The results of GNT Analyzer are held in a file with the extension .gnl file. The GNL utility enables you to examine these results.
Run the utility from the command line using the following format:
gnl filename [directives]
where the parameters are:
filename |
The name of the .gnl file containing the results. |
directives |
Directives that control the operation of the GNL utility |
The available directives are described below.
Default: NOBLOCKNUM
Shows the basic block number of each statement in the right hand margin of the source listing. This directive is useful when you are debugging code.
Default: NOCALLS
Identifies the most commonly called subprograms. Called subprograms are listed alphabetically by name. The following information is provided for each subprogram:
It is useful to identify the most commonly called routines, as the call overhead in COBOL can be considerable. The program and subprograms must have been compiled with the CSI directive to use this program.
Default: NODATAFREQ
Computes the total number of times that each data item in the program is accessed. It also identifies misaligned 2-, 3- or 4-byte items. On 386 and 486 machines data alignment can have a high performance impact. Many 486 instructions execute in a 1 clock cycle, but misaligned data adds another three cycles, and so the instruction is four times slower to execute. Similar effects can be found on other chip architectures. An item is flagged as misaligned if it meets any of the following criteria:
The top 100 most frequently accessed data items are listed in descending order of frequency together with any misaligned data items. The program and subprogram must be compiled with CSI to use this option.
Default: NOECHO
Output is echoed to the console, as well as written to the .anl file.
Default: NOFULL
Turns on the directives DATAFREQ, CALLS, VERBS and PROFILEV
A separate .anl file is produced for each separate program in the .gnl file. If you specify this directive, a single .anl file is produced. The .anl file has the same name as the .gnl file.
Default: SOURCE
A listing of the program is produced showing execution counts for each statement. This option is on by default and can be very time consuming.
Default: NOVERBS
Produces a breakdown of COBOL verb types. Three columns of information are produced, which provide the following information for each verb:
The list is sorted in descending order of execution count.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
![]() | Editor | Infomgr | ![]() |