Previous Topic: 6.11 UNIX System Services (USS) OverviewNext Topic: 6.11.2 UNIX System Services (USS) EXEC Family of Functions


6.11.1 UNIX System Services(USS) Address Space Accounting


UNIX System Services(USS) address-space-level information is
recorded in the common address-space work record, SMF type
30.

PROCESS ACCOUNTING DATA

UNIX System Services(USS) callable services provide a
repeating section for process accounting in the SMF type 30
record for the address space executed.

Events that trigger the accounting data collection are:

o  Job step termination

o  Invoking an EXEC function (substep termination)

o  SMF type 30 interval processing

o  Invoking process cleanup (undub)

Another repeating section is added to the appropriate SMF
type 30 record each time the process accounting data is
collected.

ACCOUNTING FOR FORK()

When a fork() is issued by a program, the activity of the
child process is not part of the parent process's accounting
data, meaning the child process will have its own SMF type
30 records.  An association can be made between the parent
and child processes by using the following fields:

OEPUID  - OE/MVS Process User ID
OEPUGID - OE/MVS Process User Group ID
OEPSID  - OE/MVS Process Session ID
OEPPPID - OE/MVS Parent Process ID

Data element PROGRAML (Long Program Name OE/MVS) is a 16-
character field containing the name of the program that was
executed.  When a fork() is issued, the child process matches
the program names with those in the parent process.

ACCOUNTING FOR ATTACH_EXEC

As part of setting up the UNIX System Services (USS)
interactive environment, another process called the shell is
started when the OMVS command is issued.  The purpose of this
process is to interpret and run USS interactive commands.
How the shell is started and where the shell process runs
depends on what options are specified during the setup.

IF the NOSHAREAS parameter is specified, the shell is started
using fork() and exec, which will cause the shell process to
run in its own address space.  In the address space of the
parent process, the process ID and session ID are recorded.
Resource consumption, however, is accumulated for the parent
process and all local child processes.

If SHAREAS is specified, the OMVS command starts the shell
using the attach_exec, which will start the shell process in
the same address space of the OMVS command.  The attach_exec
can be used by other applications to start a process without
the overhead of additional address space.