Next | Prev | Up | Top | Contents | Index

Using symmon's Kernel Print Command

The kernel print mode command, kp, allows the user to print kernel structures or information summarized from kernel structures. If you do not know the names of the kernel structures or summaries that you want to see, just issue the kp command without specifying an argument. If you do not specify an argument for kp, the command displays the names of all its subcommands. The ?? command lists the names of all the kp subcommands with short descriptions. For systems that do not have symmon in PROM, you may omit the leading "kp".

Some of the information you can view using the kp command is not of interest to you when debugging device drivers. In the following sections, we describe only those structures and summaries useful when debugging a device driver. kp commands that display data are also used with the idbg command (without the kp keyword).

Note: The following sections mention a number called the "process table entry index." This number is not the process ID. To find the process table entry index that corresponds to a particular process ID, issue the command: kp plist proc_id, where proc_id is the process ID for which you want to find the process table entry index.


kp buf [index/address] - View a buf Structure

The kernel can contain any number of buf type structures. Use these structures to manage data transfers to and from a device. To view all of these structures, use kp buf without specifying [index/address]. To see a particular buf type structure, specify either the buffer index number for the structure or the address for the buf type structure as the [index/address] argument.


kp eframe address

This displays the exception frame at the given address. The exception frame holds the contents of the general purpose registers at the time the process last executed. If the address is a small integer, the exception frame of the process with that process table index is used.


kp inode number/address - View an inode Structure

Use kp inode to view the contents of an inode structure. To specify which inode structure you want to see, provide the number or the address of the inode structure as the [number/address] argument. kp inode is obsolete in 5.x. See vnode structures.

Synopsis

kp inode number/address


kp kill addr

Send SIGKILL to a process, where addr is the process id.


kp mlist

List all dynamically loaded and registered kernel modules.


kp msyms id

Use ID to print symbols for the dynamically loaded module ID, which can be found using the ml list command or the lboot -V command.


kp pb -- Dump Console Print Buffer

This prints the contents of the console print buffer, which can be useful when an important message scrolls off the screen.


kp plist [#] - List Process Summaries

Without an argument, the kp command describes all the processes on the system. To see the plist information that applies to a particular process, specify the process ID as the [#] argument. Thus, to see the plist information that applies to a process with a pid of 16672, enter the command:

% kp plist 16672

The information that kp plist [#] displays for a process consists of items such as:


kp pda [index] - View a pda Structure

The pda structure contains information about a processor's private data area. If you do not specify [index], kp pda gives you the pda structure for all the processors. To see the pda structure for a specific processor only, use the [index] argument to specify the processor array index for that processor. The value of this argument must be 0 on a single-processor system or a number between 0 and n on a multiprocessor system.


kp proc index/address - View a proc Structure

A proc structure contains process-specific information not listed in the plist summaries. kp requires that you specify the proc structure you want to see. You can specify a particular proc structure by giving either the process table entry number (index) for the process or the address (address) for the proc structure (in u.u_proc.p for the currently mapped process).


kp qbuf device

Dump the contents of buffers queued for the given device. The device argument is given as the major/minor device number of the desired device.


kp runq - View the runq Structure

The runq structure contains information describing the processes in the run queue. These are processes that are not running but that could run. kp runq displays all the information for every process in the runq structure.


kp sema address - View a Semaphore Structure

The system uses sema type structures to manage the information associated with a semaphore (for example, the semaphore's name, the number of times it was used, whether it is free or locked). Use kp sema address to list the contents of a particular sema structure.


kp slpproc - View Summary of Sleeping Processes

Use this command to view information on all sleeping processes. This information includes such items as the process name, the process address, and the name and address of the semaphore upon which the process is sleeping. kp slpproc lists all the information in the slpproc structure.


kp ubt [index] - View Subroutine Backtrace Summary

Use this command to view subroutine backtrace information for a user process. This information includes such items as the stack pointer, the caller, and the called function. If you do not specify [index], this command reports on the currently mapped user process. To specify a particular user process (one that may or may not currently be mapped) give kp ubt [index], the index into the process table for the user process in which you are interested.

Caution: If a process is currently running on a CPU, you must issue the ubt command on the CPU the process is running on. Using ubt # on currently running process will produce erroneous results. kp ubt [index] is analogous to the dbx command, where.


kp user [index] - View a User Structure

The user structure contains information that describes a user area. If you do not specify [index], kp user displays the user structure for the currently mapped user. To view the user structure for a particular process (one that may or may not currently be mapped), give kp user [index], the index into the process table for the user process in which you are interested.


kp wd - View SCSI Information

Use kp WD93 to view information concerning WD93 SCSI devices.

Synopsis

kp wd [0, 1, 2, address]

Arguments

0

Use this option to display the contents of the WD93 registers. No equivalent yet exists for WD95.

1

Use this option to display the host structure and active scsi_request_t.

2

Use this option to show all allocated subchannels.

address

Use this option to show the subchannel at the specified address.

Next | Prev | Up | Top | Contents | Index