SMF: application logging subsystem
Description
"System Management Functions." A collection of programs that
record program usage statistics, including clock and CPU
time, device I/Os, and return codes. Works in conjunction
with the LINK subroutine.
Categories
Related files
JOBACCTG: Sample REPORT definition file for run statistics
compiled by SMF.
LOGFILE: Data file for the SMF subsystem. Created by
SMFINIT if not already present. Must reside in
@LOGFIL@ on the system volume.
SMFCTL: Control file for SMF log file.
SMFDISP: Object file for primary module of system.
SMFINIT: Object file for log file initialization program.
SMFLINK: Object file for program subroutine to accumulate
SMF statistics.
SMFPRINT: Object file for program to print report of system
usage.
SMFPROC: Object file for program run screen that gathers
SMF statistics.
SMFPROC1: Object file; calls SMFPROC.
VSLOGON: Object file that starts SMF logging for a
session, typically when logging on.
VSLOGOFF: Object file that ends SMF statistics for a
session, typically when logging off.
User Instructions
Gathers run-time information for a job or user by extracting
key system usage information immediately before and after
program execution. Requires program modification to call the
SMFLINK subroutine and start and stop the logging process.
The information gathered can be analyzed for system usage,
security, department billing, or many other purposes.
Once programs have been modified to gather usage statistics,
enter the options in SMFDISP
and display the usage statisics
by user ID, workstation number, or
program name. SMFDISP will also print reports and
initialize (purge) the log file.
SMF records job statistics in the file LOGFILE in @LOGFIL@ on
the system volume. Through the SMFDISP program (or REPORT,
INQUIRY, or a report program), the administrator can review
usage by user, program, or workstation. SMFDISP will also
allow the administrator to print the contents of the log and
initialize the log file. The VSLOGON and VSLOGOFF programs
allow logging of total run times for user sessions.
Programmer Instructions
Nearly all SMF modules are designed for interactive use;
nonetheless, none of the canned reports will suit many
environments and it is up to the programmer to make effective
use of the data gathered by SMF. The file format is as
follows:
- Program name: The name of the program run.
- User ID: The user's 3-character user ID.
- Date and time: The date and time of the run. Note that
only the last digit of the year is stored; the decade or
century are not included.
- Workstation number: the 3-digit workstation ID.
- Return code: the return code from execution of the SMFLINK
subroutine.
- Library and volume: the location of the program run.
- User name: the 24-character name.
- Elapsed time: elapsed time in seconds.
- CPU time: CPU time in hundredths of a second.
- Disk I/Os: the amount of disk input/output activity during
the run.
- Paging activity: the number of times the program was paged
in and out by the system or the program.
The arguments for the SMFLINK subroutine are as follows:
Function PIC X(08) The function code for the process to
be performed. Defined as follows:
0 Start logging
1 Stop logging and write to file
2 Stop logging and write to file
under another name (see NAME,
below).
3 Stop logging, write to file, and
return statistics to the calling
program.
4 Stop logging, write to file under
another name, and return
statistics to the calling program.
Name PIC X(08) Optional; alternate program name for
options '2' and '4'.
Data PIC X(150) Optional; contains statistics for
options '2' and '4'.
Example of use
As mentioned above, a simple method for integrating SMF
logging into menus is to use the MENUGEN Useraid and select
the SMF option. Here is how that might be done:
- Revise (or create) EZFORMAT screen files for the menus to
be logged.
- Run MENUGEN and select the EZFORMAT file to be used as
input. Review PF key selection, noting especially the SMF
field (the bottom of the screen) and the syntax differences
between MENUGEN's RUN and EXIT options. (See MENUGEN
documentation for further information.)
- Create or modify REPORT definitions to sort and select
records as your needs dictate.
- Set up a schedule for routine reporting and log file
initialization. (Regular reporting and initialization will
be required to keep the log file size to reasonable levels.)
Comments
An application logging system. Requires program modification
to use, and the log file must be periodically purged.
Program bugs: early versions allowed only two characters for
a workstation number; this has been fixed in the recent
version. Also, the date is stored in the log file without
the century or decade positions, so SMFDISP screen displays
arbitrarily add '197' to the year digit (e.g. 'January 1,
1988' becomes '01/01/78' on the screen display). If desired,
this element can be changed with the Wang PATCH utility or with
EZPATCH.