HP-UX 11i Version 1.5 Kernel Logging

Kernel Logging
Using Kernel Logging
Chapter 116
WARNING The WARNING class signals an abnormal event, possibly
caused by problems in an individual subsystem
INFORMATIVE The INFORMATIVE class signals important routine
operations and current system values.
ss ss is the ID of the subsystem the instrumentation point belongs to. It will be
cast to type unsigned short.
p[0-4] p[0-4] are five long integers logged by KL as user-defined data. They will
be cast to type long.
cp cp is a pointer to a string to be logged. It will be cast to type char*.
dp dp is a pointer to a data structure. It will be cast to type caddr_t.
len len is the length of the data structure. It will be cast to type int.
Description
The macros KL_LOG_INFO(), KL_LOG_STR(), and KL_LOG_DATA() are entry points to the
Kernel Logging infrastructure. These macros are called from the variety of functions in the
different subsystems within the kernel. Each of the three macros is used to record a message
sent from the kernel with specific user-defined data:
KL_LOG_INFO() is used to pass five long integers as user-defined data.
KL_LOG_STR() is used to pass a string as user-defined data. This macro can also be used if
no user-defined data is supplied; in such cases, the pointer to a string should
be NULL.
KL_LOG_DATA() is used to pass an abstract data structure as user-defined data.
NOTE User-defined data should not exceed the value of MAXPATHLEN, which is
currently 1024. This amount of data should be enough to store a filename
(along with the full path) using the KL_LOG_STR() macro. If user-defined data
exceeds MAXPATHLEN bytes, then only the first MAXPATHLEN bytes will be logged.
Using the KL_LOG_STR() and KL_LOG_DATA() macros with long (more than
100 bytes) of user-defined data should be done sparingly. The cp and dp
parameters must point to the strings and data structures which reside in
kernel memory space, not user space.
These macros check whether a message issued by a particular instrumentation point should
be logged by the Kernel Logging infrastructure. The check will be based on two parameters:
whether the subsystem ID supplied by the instrumentation point falls into the KL range of