HP-UX 11i Version 1.5 Kernel Logging
Kernel Logging
Instrumenting Kernel Subsystems for Kernel Logging
Chapter 1 7
Continuing the example of the Dynamic Tuning subsystem, and assuming that the
developer had decided the event is an INFORMATIVE event, and that it is the first
event of that class in the subsystem, the entry in the local header file for this event
would be as follows:
KL_DYNTUNE_SETTUNE_EVENT=5000
Add KL Instrumentation Points to Your Subsystem
The three macros listed in the table below are the entry points to the Kernel Logging
infrastructure. (These macros represent Kernel Logging Instrumentation Points.) Use them
to record the dynamic parts of the user-friendly messages that will be logged from your
subsystem. User-friendly messages are discussed in the next section of this document.
Step 1. Select the point in your subsystem code to be instrumented for Kernel Logging.
IMPORTANT Do not instrument MALLOC and FREE macros: They are used in the KL
infrastructure itself, and recursion will occur if you instrument them.
Step 2. Select the KL macro you want to call, based upon the specific type of information
you want to pass to the kernel log. (See the manual page at the end of this
document for complete information on the use of the macros.)
Step 3. Construct a user-friendly message for this instrumentation point, and add it to the
message catalog file. (See the following procedure for details on doing this.)
Construct a User-Friendly Message to be Associated with an Instrumentation Point
Table 1-2
Macro Name Description
KL_LOG_INFO() This macro passes up to five long integers as user-defined
data.
KL_LOG_STR() This macro passes a string as user-defined data. It can also
be used if no user-defined data is supplied; in such a case
the pointer to a string should be NULL.
KL_LOG_DATA() This macro passes a data structure as user-defined data.
This information is dumped in hexidecimal by the Kernel
Logging infrastructure. For information on how to format it
for readability, see netfmt(1M) or the Device Drivers Guide.