mdb Command
The modular debugger, mdb, is the recommended post-mortem debugger for the kernel. This debugger also includes a number of desirable usability features such as command-line editing, command history, built-in output pager, syntax checking, and command pipelining. A programming API is available that enables a compilation of modules to perform desired tasks within the context of the debugger.
For more information, see the Oracle Solaris Modular Debugger Guide and the mdb(1) man page.
Example 1-2 Using mdb to Display Information
Display a high-level view of a system's memory usage.
Note that the following command uses the ‐-kernel option in place of the obsolescent ‐k option:
# mdb --kernel --unsafe-io-access
Loading modules: [ unix genunix specfs dtrace mac cpu.generic
cpu_ms.AuthenticAMD.15 uppc pcplusmp scsi_vhci zfs mpt sd ip
hook neti arp usba sockfs kssl qlc fctl stmf stmf_sbd md lofs
random idm fcp crypto cpc smbsrv nfs fcip sppp ufs logindmux
ptm nsmb scu mpt_sas pmcs emlxs ]
> ::memstat
Page Summary Pages MB %Tot
------------ ---------------- ---------------- ----
Kernel 160876 628 16%
ZFS File Data 303401 1185 30%
Anon 25335 98 2%
Exec and libs 1459 5 0%
Page cache 5083 19 1%
Free (cachelist) 6616 25 1%
Free (freelist) 510870 1995 50%
Total 1013640 3959
Physical 1013639 3959
> $q
When using either the kmdb or mdb debugger, the module name prefix is not required. After a module is loaded, its symbols form a common name space with the core kernel symbols and any other previously loaded module symbols.