smf_record (BPX1SMF, BPX4SMF) — Write an SMF record

Function

The smf_record callable service writes an SMF record to the SMF data set. The caller must be permitted to the BPX.SMF resource profile in the FACILITY class or must be APF-authorized.

The service can also be used to determine if a particular type or subtype of SMF record is being recorded. This avoids the overhead of data collection if the SMF record is not going to be recorded.

Requirements

Operation Environment
Authorization: Supervisor state or problem state, any PSW key
Dispatchable unit mode: Task
Cross memory mode: PASN = HASN
AMODE (BPX1SMF): 31-bit
AMODE (BPX4SMF): 64-bit
ASC mode: Primary mode
Interrupt status: Enabled for interrupts
Locks: Unlocked
Control parameters: All parameters must be addressable by the caller and in the primary address space.

Format

CALL BPX1SMF,(Smf_record_type,
              Smf_record_subtype,
              Smf_record_length,
              Smf_record_address,
              Return_value,
              Return_code,
              Reason_code)

AMODE 64 callers use BPX4SMF with the same parameters. The Smf_record_address parameter is a doubleword.

Parameters

Smf_record_type
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a fullword that contains the SMF record type. See z/OS MVS System Management Facilities (SMF) for information on SMF record type and SMF record layout.

Smf_record_subtype
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a field that contains the SMF record subtype. See z/OS MVS System Management Facilities (SMF) for information about SMF record type and SMF record layout.

Smf_record_length
Supplied parameter
Type:
Integer
Length:
Fullword

The name of a field that contains the SMF record length.

Smf_record_address
Supplied parameter
Type:
Address
Length:
Fullword (doubleword)

The name of a fullword (doubleword) that contains the starting address of the SMF record to be written, or zero. If it contains zero, SMF is tested to determine if a particular record type or subtype is being recorded.

Return_value
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the smf_record service returns 0 if the request is successful, or -1 if it is not successful.

Return_code
Returned parameter
Type:
Integer
Length:
Fullword
The name of a fullword in which the smf_record service stores the return code. The smf_record service returns Return_code only if Return_value is -1. For a complete list of possible return code values, see z/OS UNIX System Services Messages and Codes. The smf_record service can return one of the following values in the Return_code parameter:
Return_code Explanation
EINVAL The value that was specified for an operand was incorrect. The following reason code can accompany the return code: JRSMFBadRecordLength.
ENOMEM Not enough storage is available. The following reason code can accompany the return code: JRNoStorage.
EPERM The calling process is not permitted to the BPX.SMF resource in the FACILITY class and the calling processes is not APF authorized. The following reason code can accompany the return code: JRSMFNotAuthorized.
Reason_code
Returned parameter
Type:
Integer
Length:
Fullword

The name of a fullword in which the smf_record service stores the reason code. The smf_record service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.

Usage notes

Related services

There are no related services.

Characteristics and restrictions

The caller must be permitted to the BPX.SMF resource profile in the FACILITY class.

Examples

For an example using this callable service, see BPX1SMF (smf_record) example.

MVS-related information

  1. See z/OS MVS System Management Facilities (SMF) for information on SMF record types and SMF record layout.
  2. See Setting up the BPX.* FACILITY class profiles in z/OS UNIX System Services Planning for a description of the BPX.SMF FACILITY class profile and how it is created.