HP-UX 11i Version 1.5 Kernel Logging

Kernel Logging
Instrumenting Kernel Subsystems for Kernel Logging
Chapter 14
Instrumenting Kernel Subsystems for Kernel Logging
Although the KL (Kernel Logging) infrastructure is maintained by the KL team (email:
KL_team_NJ@fpk.hp.com), it makes sense that the instrumentation of specific kernel
subsystems be accomplished by those who know them best: the subsystem owners.
Instrumenting a kernel subsystem for kernel logging comprises the three main tasks listed
here. Each task is explained in the sections that follow.
Ascertain that an appropriate ID is defined for your subsystem
Create a local header file for event IDs specific to your subsystem
Add KL instrumentation points to your subsystem
Ascertain That an Appropriate ID is Defined for Your Subsystem
A subsystem ID is a unique string that identifies your subsystem to the KL infrastructure. It
must be unique among the subsystem IDs, and evaluate to an integer in the range [513-1023].
When it is defined, as described in this procedure, your subsystem will be assigned the next
available integer.
Several subsystem IDs have already been defined: they are listed, under the comment /* KL
supported subsystems */, in the file/ux/core/kern/common/sys/subsys_id.h. For
example:
/* KL supported subsystems */
#define KL_FORMATTER 512
/* The values for KL subsystems must be within 513 and 1023 */
/* since 512 value is reserved for the KL formatter */
#define KL_VM 513
#define KL_PKM 514
#define KL_DLKM 515
#define KL_PM 516
#define KL_VFS 517
#define KL_VXFS 518
etc.
Step 1. Send mail to the KL team (KL_team_NJ@fpk.hp.com) describing the code to be
instrumented and discuss with them what the ID for your subsystem should be.
Step 2. If you and the KL team decide to use a pre-existing subsystem ID for your
instrumentation work, you are done with this task.