PROFILER - Profile a Natural Session

#### Search Results

Search

# PROFILER - Profile a Natural Session

This profile parameter is used to profile a Natural session. The profiling data is written to a resource file you can analyze with the Natural Profiler in NaturalONE. For more information, see the NaturalONE documentation.

Possible settings | See PROFILER Parameter Syntax.
Default setting | none | See the default settings of the subparameters in PROFILER Parameter Syntax.
Dynamic specification | yes |
Specification within session | no |

## PROFILER Parameter Syntax

The `PROFILER` parameter is specified as follows:

`PROFILER=`{`(`subparameter`=`value[`,`subparameter`=`value]`...)`}

Important
Blank spaces are not allowed in the syntax. Use commas to separate the syntax elements.

Where:

Subparameter | Value | Explanation
--- | --- | ---
`ACTIVE` |  | `ACTIVE=value` determines whether the profiling infrastructure is activated. Default: `OFF`
`ON` | The profiling infrastructure is activated and events are written to the resource file.
`OFF` | The profiling infrastructure is deactivated.
`EVENT` |  | `EVENT=value` specifies the types of events to be generated into the resource file. The following syntax applies:
    event|(event[,event]...)
where: `event` is either the type of an event (`event-type`) or a group of event types (`event-group`). Default: All event types are processed.
`event-type`: `SI|ST|PL|PS|` `PT|PR|DA|DB|IA|` `IB|CA|CB|NS|E|U` | `event-type` is one of the following:
`SI` | Session initialization event
`ST` | Session termination event
`PL` | Program load event
`PS` | Program start event
`PT` | Program termination event
`PR` | Program resume event
`DA` | After database call event
`DB` | Before database call event
`IA` | After terminal I/O event
`IB` | Before terminal I/O event
`CA` | After external program call event
`CB` | Before external program call event
`NS` | Natural statement event
`E` | Runtime error event
`U` | User-defined event
Notes: Natural statement events (`NS`) are only generated if the corresponding Natural object was compiled with `SYMGEN=ON` (see the `SYMGEN` profile parameter)! In addition to the events listed above, the Natural Profiler collects monitor pause events (`MP`) when the data collection is paused. The duration of the pause is not considered by the application performance analysis.
`event-group`: `S|P|D|I|C|N` | `event-group` is one of the following:
`S` | Session event group (`SI`, `ST`)
`P` | Program event group (`PL`, `PS`, `PT`, `PR`)
`D` | Database call event group (`DB`, `DA`)
`I` | Terminal I/O event group (`IB`, `IA`)
`C` | External program call event group (`CB`, `CA`)
`N` | Natural event group (`NS`)
`EVENTTRACE` |  | `EVENTTRACE=value` determines whether individual events are written to the resource file. Default: `OFF`
`ON` | Individual events are written to the resource file. You can examine the recorded events in the NaturalONE Event Trace page. The generated resource file has the extension `.nprf` (Natural Profiler resource file). Caution The resulting file can become very large, especially when statement events are recorded.
`OFF` | Individual events are not written to the resource file. Only consolidated hot-spot information is recorded in the file. This typically results in a much smaller file that is consequently much quicker to process. The generated resource file has the extension `.nprc` (Natural Profiler resource consolidated).
`INTERVAL` | `1|2|4|5|8|10|` `16|20|25|40|50|` `80|100|125|200|` `250|400|500|625|` `1000|1250|2000|` `2500|5000|10000` | `INTERVAL=value` specifies the CPU time interval (in microseconds) to be used if `SAMPLING` is active. With sampling, only the last event of each sampling interval is recorded. Exception: Session events (event types `SI` and `ST`) are always recorded. Larger sampling intervals result in fewer events recorded and thus smaller resource files. However, larger sampling intervals also result in less accurate values. Default: `100`
`RESLIB` | 1 – 8 characters | `RESLIB=value` specifies the name of the FUSER system library that contains the resource file. Default: `SYSTEM`
`RESNAME` | 1 – 253 characters | `RESNAME=value` specifies the name of the resource file (without path and extension) into which the data is written. Default: A file name is automatically generated containing the current user ID and timestamp.
`SAMPLING` |  | `SAMPLING=value` determines whether sampling is activated. The sampling method uses a statistical approach to collect data. Sampling significantly reduces the amount of data written to the resource file while approximately retaining the same CPU times as without sampling. Caution Sampling gives an estimation of the consumed CPU time. Other values like the elapsed times or hit counts are not reliable when sampling is used. For details on sampling, see the Sampling in the Natural Profiler Utility - Batch Mode section of the Natural for z/OS documentation. Default: `OFF`
`ON` | Sampling is activated.
`OFF` | Sampling is deactivated. This is the default setting for this subparameter in the Natural parameter file.
`FLAGS` |  | `FLAGS=value` allows option flags to be passed to the profiler. Note that these are bitmask values. To combine option flags, you must specify the sum of their individual numerical values.
2 | Write a data collector trace file to the Natural temporary directory (see the `TMP_PATH` entry in the NATURAL.INI file).
8 | Trace resource file generation to the Natural temporary directory. Does not apply if profiling via NaturalONE, where the profiling data is sent directly to the client instead of being written to a resource file on the server.
64 | Do not create an elapsed time timer (elapsed times will all be 0).
128 | Use an elapsed time timer for the CPU times. The timer is paused while waiting for user input. Has the benefit that elapsed times are often much quicker to measure than CPU times, reducing the profiling overhead and thus improving the accuracy of the profiling results.
512 | If this flag is specified, the profiler attempts to deduct as much of the profiling overhead as possible from the measured CPU times, further improving the accuracy of the profiling results.

## Examples of PROFILER Parameter

#### Example 1: Profile with all Events

    PROFILER=(ACTIVE=ON,EVENTTRACE=ON,EVENT=(S,P,D,N,I,C,E,U))

All individual events are recorded.

#### Example 2: Profile with Program Load Event

    PROFILER=(ACTIVE=ON,EVENT=PL,RESNAME=MYAPP,RESLIB=MYLIB)

All program load events (`PL`) are written to the resource file `MYAPP` in the library `MYLIB`.

#### Example 3: Profile with Sampling

    PROFILER=(ACTIVE=ON,EVENT=(P,NS),SAMPLING=ON,INTERVAL=1000)

All programs of the event group `P` and the event `NS` are recorded using sampling with a sampling interval of 1000 microseconds.

#### Example 4: Sampling versus Non-Sampling

A Natural application is profiled twice. In a first run, without sampling:

    PROFILER=(ACTIVE=ON)

The Natural Profiler generates 240,086 events and shows a CPU consumption of 30.2 percent for a called subprogram.

In the second run, the same application is profiled with sampling:

    PROFILER=(ACTIVE=ON,SAMPLING=ON,INTERVAL=100)

The Natural Profiler now generates only 4,100 events and shows a CPU consumption of 30.1 percent for the same subprogram.

### On this page

- PROFILER Parameter Syntax
- Examples of PROFILER Parameter