PreviousEditor InfomgrNext

Chapter 8: GNT Analyzer

This chapter describes GNT Analyzer.

8.1 Introduction

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. Programs 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 in batch mode, so you can see only the finished analysis. However, since the application runs at almost full speed, you get the results quickly.

Once GNT Analyzer has created the statistics, you view them with the GNL utility. This utiity is part of GNT Analyzer.

Figure 8-1 illustrates how GNT Analyzer provides program statistics.



Figure 8-1: GNT Analyzer

The following sections describe how to invoke and use GNT Analyzer.

8.2 Using GNT Analyzer

You control GNT Analyzer by setting directives on the command line, and by the settings in a configuration file.

To perform GNT analysis on your code:

  1. Compile your programs with the GNTANLZ directive.

  2. Set the environment variable GNTANLZ so that it specifies the name of the configuration file to use.

  3. Run your program to produce a .gnl results file.

More detailed information about these steps is provided in the following sections.

8.2.1 Compiling your Program

The first step in the analysis is to compile your program using the GNTANLZ directive. This directive takes the form:

GNTANLZ=parameter

where parameter can be one of the following:

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's Guide for information on how to set Compiler directives.

8.2.2 Examining the Results

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.

8.3 The GNL Utility

The results of GNT Analyzer are held in a file with the extension .gnl. The GNL utility enables you to examine these results.

Run the utility from the command line using the following format:

gnl filename [options]

where the parameters are:

filename The name of the .gnl file containing the results.
options Options that control the operation of the GNL utility

The available options are described below.


[NO]BLOCKNUM

Shows the basic block number of each statement in the right hand margin of the source listing. This option is useful when you are debugging code.

Default:

NOBLOCKNUM


[NO]CALLS

Identifies the most commonly called subprograms. To use this option you must compile the program and subprograms with the CSI Compiler directive.

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.

Default:

NOCALLS


[NO]DATAFREQ

To use this option, you must compile the program and subprogram with the CSI Compiler directive.

This option counts the total number of times that each data item in the program is accessed. It also identifies misaligned 2-byte, 3-byte and 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.

Default:

NODATAFREQ


[NO]ECHO

Default: NOECHO

Output is echoed to the console, as well as written to the .anl file.

Default:

NOECHO


[NO]FULL

Turns on the options DATAFREQ, CALLS and VERBS.

Default:

NOFULL


SINGLE

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.


[NO]SOURCE

A listing of the program is produced showing execution counts for each statement. Using this directive can slow the analysis. This option is on by default.

Default:

SOURCE


[NO]VERBS

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.

Default:

NOVERBS



Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousEditor InfomgrNext