Trace Application Logic and Resource Utilization with Natural Profiler

.pearl-hilighted-word {background-color: #ffffff !important; color: #000000 !important;}
Issue 3, 2012 Download pdf

Natural for Mainframes v8.2.2 includes a new utility called Natural Profiler. Natural Profiler is used to monitor the internal process flows of an application and to record trace data for select events that are performed within Natural applications.

Natural Profiler helps application programmers, administrators and quality engineers analyze the logical flow of Natural applications and to trace the utilization of resources during run-time. This utility is menu-based and provides functions to control tracing, to select event types, and to maintain trace records.  During a Natural session, different kinds of events can occur such as "start a program". Data specific to an event is collected in a trace record. Each event is associated with an event type that is a one- or two-letter code.

Event types are available for the following:

  • Program Load
  • Program Start
  • Program Termination
  • Before / after Data Base Call
  • Before / after Terminal I/O
  • Before / after External Program Call
  • Runtime Error
  • Natural Statement
  • User Defined Event

With each event in Natural Profiler, there are a number of possible actions a programmer can pursue, such as:

  • Select Events to be Profiled
  • Start/Stop Profiler Tracing
  • List Trace Records
  • Print Trace Records
  • Download Trace Records

The Natural Profiler utility screen, shown in Figure 1, provides an example of “Display Trace Record” for a program and shows key information such as:

  • Elapsed Time of Event
  • Line of the Event in the Program
  • Program Level

`10:14:01              ***** NATURAL PROFILER UTILITY *****           2011-03-29`

`User SAG                    - Display Trace Record -                 79 records`

`Record / Event .... 10____  /  PL - Program load                               `

`Event time ........ 10:12:14.130696    Elapsed time ....... 0.000157           `

`CPU time .......... 0                                                          `

`Current user ID ... SAG                Current group ID ...                    `

`Current program ... DYNAMX06           Library ............ SYSEXPG            `

`Program level .....                    Program line ....... 0160                   `

`                                                                               `

`Loaded program .... DYNAMX05           Invocation type .... CALLNAT            `

`Library ........... SYSEXPG  `

`                                                 `

`                            `

`                                                   `

`Enter required record number, or use PF6 - PF9 for paging.                     `

`Command ===>                                                                   `


`      Help        Exit              --    -     +     ++                Canc `

FIGURE 1: Example of Display Trace Record

Natural Profiler can be thought of as a debugger utility for Natural objects during execution. Natural Profiler helps programmers hunt down any under-performing programs and blocks of code so that they can be modified.  Future plans for Natural Profiler include integration with NaturalONE.