What kdb callable functions exist under DEBUG & DEBUG_TOOLS? This is a list of special kdb flags that are available only when using the kstuff'ed kernels. To access these functions, the following are required: - You must be running a kstuff'ed kernel - kdb must be installed in the kernel - Your driver must be compiled with the same flags as the kstsuff'ed kernel you are using. ===================================================================== Asynchronous I/O functions -------------------------- print_aio(aio_t *aiop) io/async/async.c print_aio_stats(void) io/async/async.c print_aioproc(proc_t *procp) io/async/async.c Buffer Cache Functions ---------------------- print_bfreelist_id(void) fs/bio.c Prints identify-related fields for buffers on the freelist. print_bfreelist_links(void) fs/bio.c Prints linkage fields for buffers on the freelist print_buf(buf_t *bp) fs/bio.c Prints a buffer header structure print_buf(buf_t *bp) io/vxvm/unixware/debug.c Prints a buffer header structure print_bufhash_id(void) fs/bio.c Prints identity-related fields for buffers in the hash table print_bufhash_links(void) fs/bio.c Prints linkage fields for buffers in the hash table print_bufpool(void) fs/bio.c Prints miscellaneous buffer pool info Directory Name Lookup Cache Functions ------------------------------------- find_dnlc_by_dp(vnode_t *dp) fs/dnlc.c Finds and prints dnlc entries with directory vnode, dp find_dnlc_by_name(char *nm) fs/dnlc.c Finds and prints dnlc entries with filename, nm find_dnlc_by_vp(vnode_t *vp) fs/dnlc.c Finds and prints dnlc entries with target vnode, vp print_dnlc_counts(void) fs/dnlc.c Prints name cache size, freecount, hash count print_dnlc_hash(void) fs/dnlc.c dump the dnlc cache print_dnlc_hashlk(int hnum) fs/dnlc.c print hash anchor, locked pid, lwpid Filesystem Functions -------------------- print_cdfs_freelist(void) fs/cdfs/cdfs_inode.c print cdfs inodes on the freelist print_cdfs_hash(void) fs/cdfs/cdfs_inode.c print cdfs inodes in the hash table print_cdfs_inode(struct cdfs_inode *ip) fs/cdfs/cdfs_inode.c print a cdfs inode print_dosnode(struct denode *dep) fs/dosfs/dosfs_denode.c print_dosvfs(struct dosfs_vfs *pvp) fs/dosfs/dosfs_denode.c print_dow(dowid_t i) fs/dow_check.c print_file(file_t *fp) fs/fio.c print a file structure print_mnode(mnode_t *mp) fs/memfs/memfs_mnode.c prints a memfs mnode structure print_mnode_bs(memfs_bs_t *bsnp, size_t size) fs/memfs/memfs_mnode.c prints backing-store information for a memfs mnode bsnp is a memfs_bs_t pointer, size is the mnode file size print_mnode_dir(mnode_t *mp) fs/memfs/memfs_mnode.c print_mnodes(void) fs/memfs/memfs_mnode.c print all memfs mnodes print_prnode(prnode_t *prp) fs/procfs/prsubr.c print a procfs prnode structure print_s5_bucket(struct hinode *ih) fs/s5fs/s5inode.c print_s5_freelist(void) fs/s5fs/s5inode.c prints s5fs inodes on the freelist print_s5_hash(void) fs/s5fs/s5inode.c prints s5fs inodes in the hash table print_s5_inode(inode_t *ip) fs/s5fs/s5inode.c prints an s5 inode print_sfs_cg(cg_t *cgp) fs/sfs/sfs_alloc.c prints an sfs cylinder-group structure print_sfs_freelist(void) fs/sfs/sfs_inode.c prints sfs inodes on the freelist print_sfs_hash(void) fs/sfs/sfs_inode.c prints sfs inodes in the hash table print_sfs_inode(inode_t *ip) fs/sfs/sfs_inode.c prints an sfs inode print_snode(snode_t *sp) fs/specfs/specsubr.c prints a specfs snode structure print_ufs_inode(inode_t *ip) fs/sfs/sfs_inode.c prints an ufs inode print_vfs(vfs_t *vfsp) fs/vfs.c prints a vfs structure print_vnode(vnode_t *vp) fs/vnode.c prints a vnode print_vnode_mnode(vnode_t *vp) fs/memfs/memfs_mnode.c prints the memfs mnode for a (memfs) vnode Kernel Memory Allocator Functions --------------------------------- print_kma_hist(char *ctrl, ...) mem/kma.c NOTE: Available only when compiled with _KMEM_HIST. The ctrl string, if non-blank, specifies constraints on which history entries to print. The default is to print everything. Each letter in the ctrl string creates an additional constraint. Corresponding to each letter is a successive additional argument to kma_print_hist(), which is the value for which the constraint applies. Case is ignored (i.e. 'A' is the same as 'a'). Each letter (except 'N') may be preceded by '!' to reverse the sense of the comparison. Valid control string includes zero or more command characters in either upper or lower case. For each command character, there is an additional argument. Any command character except 'N' may be preceded by '!' to reverse the sense of the comparison. Valid control characters are as follows: L: LWP == arg A: addr == arg S: size == arg (rounded to KMA buffer size) 2: size == arg (rounded to next power of 2) C: addr is in same chunk as arg F: filename == arg N: consider only youngest arg history entries print_kma_pools(void) mem/kma.c prints out per-pool allocation information (in the global pools) print_kma_stats(void) mem/kma.c NOTE: Available only when compiled with _KMEM_STATS. prints out kma statistics Kernel Synchronization Functions -------------------------------- print_lkstat(lkstat_t *statp) util/locktest.c NOTE: When compiled with _MPSTATS and DEBUG or SPINDEBUG, lock acquisition and release times are recorded in a lkstat_t structure associated with each lock. This function displays the contents of one of the lkstat_t structures. dump statistics of a given lock. print_lock_stats(void) util/locktest.c print system-wide locking metrics. NOTE: These metrics are collected only when compiled with _MPSTATS and DEBUG or SPINDEBUG print_locks(int cpu) util/locktest.c Prints locks held on the given CPU, or all CPUS if -1. NOTE: When compiled with _LOCKTEST and DEBUG or SPINDEBUG set, spin lock acquisitions and releases are tracked on per-processor lock stacks. This function displays the contents of that stack, for one, or all processors. print_rwlock(rwsleep_t *lockp) util/rwsleep.c dump statistics about a read/write sleep lock print_sleep_lock(sleep_t *lockp) util/sleep.c dump statistics about a sleep lock. Memory Management Functions --------------------------- conv_phystopp(uint_t v) mem/vm_page.c converts a physical address to a page pointer conv_pptonum(page_t *pp) mem/vm_page.c converts a page pointer to a physical page frame number find_page_by_id(vnode_t *vp, off64_t off) mem/vm_page.c finds and prints the page with identity find_smap_by_addr(vaddr_t addr) mem/seg_map.c finds and prints the segmap smap struct for segmap address, vaddr find_smap_by_id(vnode_t *vp, off64_t off) mem/seg_map.c finds and prints the segmap smap struct with identity print_active_pages(void) mem/vm_page.c prints all active (read or write locked) pages print_anon_hist(anon_t *ap) mem/vm_anon.c prints the history information for an anon_t. NOTE: Available only when compiled with ANON_DEBUG. print_anon_info(void) mem/vm_anon.c print miscellaneous information about anonfs print_as(struct as *as) mem/vm_as.c prints an AS (address space) structure print_as_chain(struct as *as) mem/vm_as.c print_carve_kspace(void) mem/vm_sysinit.c print the value of kernel segment addresses and sizes print_free_pages(void) mem/vm_page.c print a table of the free pages print_hat_log(uint_t engnum) mem/vm_hat.c print miscellaneous information from hat lock record for give CPU print_hatpt(struct as *as) mem/vm_hat.c print_kmp(struct kmp *kmp) mem/seg_kvn.c print_kpg_stats(void) mem/seg_kmem.c print out memory reservation statistics print_kpg_zbm(void) mem/seg_kmem.c print out the internal ZBM data structures for kpg print_kvtol1ptep(vaddr_t addr) mem/vm_hat32.c print_kvtol1ptep64(vaddr_t addr) mem/vm_hat64.c print_kvtol2ptep(vaddr_t addr) mem/vm_hat32.c print_kvtol2ptep64(vaddr_t addr) mem/vm_hat64.c print_kvtol2ptep64_g(vaddr_t addr, cgnum_t cgnum) mem/vm_hat64.c print_kvtol2pteptep64_g(vaddr_t addr, cgnum_t cgnum) mem/vm_hat64.c print_kvtophys(vaddr_t addr) mem/vm_hat32.c print_kvtophys64(vaddr_t addr) mem/vm_hat64.c print_kvtopp(vaddr_t addr) mem/vm_hat.c print_mapped_pages(void) mem/vm_page.c prints all mapped pages print_mem_resv_stats(void) mem/memresv.c print mem_resv statistics print_pae_page_table(pte64_t *ptep) mem/vm_hat64.c print_page(page_t *pp) mem/vm_page.c prints a page structure print_page_info(void) mem/vm_page.c prints summary info on pages print_page_mappings(page_t *pp) mem/vm_page.c print_page_plocal_stats(void) mem/vm_page.c prints per-cpu page metrics print_page_set(page_t *pp) mem/vm_page.c print_page_stats(void) mem/vm_page.c prints extra page statistics print_page_table(pte_t *ptep) mem/vm_hat32.c print_proc_as(proc_t *procp) mem/vm_as.c prints the AS (address-space) structure for a process print_proc_as_chain(proc_t *procp) mem/vm_as.c print_ptpp(page_t *ptpp) mem/vm_hat.c print_rzbm(void) mem/vm_rzbm.c print_rzbm_cell(rzbm_t *zbmp, struct rzbm_cell *cellp) mem/vm_rzbm.c print_rzbm_stats(void) mem/vm_rzbm.c print_segkvn_stats(void) mem/seg_kvn.c prints segkvn statistics print_segkvn_zbm(void) mem/seg_kvn.c prints ZBM info for segkvn print_segmap_stats(void) mem/seg_map.c prints debug statistics for segmap print_segmki(struct seg *seg) mem/seg_mki.c print_smap(struct smap *smp) mem/seg_map.c prints a segmap smap_t structure print_smki_list(char *s, list_t *l) mem/seg_mki.c print_vnode_pages(vnode_t *vp) mem/vm_page.c print vnode page list from v_pages print_vnode_segs(vnode_t *vp) mem/vm_page.c print all segments mapping a vnode print_zbm(zbm_t *zbmp) mem/vm_zbm.c prints a zbm_t structure print_zbm_cell(zbm_t *zbmp, struct zbm_cell *cellp) mem/vm_zbm.c prints a ZBM zbm_cell structure print_zbm_stats(zbm_t *zbmp) mem/vm_zbm.c prints ZBM statistics for a zbm_t structure Metrics and Miscellaneous Statistics Functions ---------------------------------------------- print_intr_stats(int cpu) util/locktest.c When compiled with DEBUG or SPINDEBUG, various interrupt statistics are gathered on a per-processor basis. This function prints those statistics. This function accepts the processor ID as the argument. If a negative processor ID is specified, the interrupt statistics of all the processors in the system are displayed. print_metrics(void) util/metrics.c prints assorted system wide metrics as well as per-processor metrics from counters declared in metrics.h. These are the counters that sadc collects for sar reports. System-wide counters are printed first, then per-processor counters are printed along with a total. Networking Functions -------------------- dlpi_card(per_card_info_t *cp) io/nd/dlpi/main.c prints contents of a per_card_info structure dlpi_dblk(dblk_t *dp) io/nd/dlpi/main.c print contents of a dblk_t dlpi_lock_t_print(lock_t *lp) io/nd/dlpi/main.c print contents of a lock_t dlpi_locks(per_card_info_t *cp) io/nd/dlpi/main.c print locks in a per_card_info structure dlpi_mblk(mblk_t *mp) io/nd/dlpi/main.c prints contents of a mblk dlpi_queue(queue_t *qp) io/nd/dlpi/main.c prints contents of a queue dlpi_sap(struct per_sap_info *sp) io/nd/dlpi/main.c prints contents of a per_sap_info structure print_igmptimers(void) net/inet/igmp.c print_inpcb(inpcb_t *inp) net/inet/in_pcb.c print_inpcb_hash_list(struct inpcbinfo *pcbinfo, int entry) net/inet/in_pcb.c print_inpcb_hash_table(struct inpcbinfo *pcbinfo) net/inet/in_pcb.c print_inpcb_linked_list(struct inpcbinfo *pcbinfo) net/inet/in_pcb.c print_inpcb_list(inpcb_t *pcbhead) net/inet/in_pcb.c print_inpcb_port(struct inpcbport *inpport) net/inet/in_pcb.c print_inpcb_port_hash_list(struct inpcbinfo *pcbinfo, entry) net/inet/in_pcb.c print_inpcb_port_hash_table(struct inpcbinfo *pcbinfo) net/inet/in_pcb.c print_mfctable() net/inet/ip_mroute.c print_optmgmt_req(mblk_t *bp) net/netsubr.c print_viftable() net/inet/ip_mroute.c Process Management Functions ---------------------------- print_cred(cred_t *crp) proc/cred.c prints a cred_t structure print_dispmetrics(int cpu) proc/disp.c Under the _MPSTATS compilation option, the kernel has been instrumented to collect metrics related to processor scheduling. This function accepts the processor ID as the argument. If a negative ID is specified, the dispatch metrics of all the processors are displayed. print_dshm(struct kdshmid_ds *kdp) proc/ipc/dshm.c print_lwp(lwp_t *lwpp) proc/lwpsubr.c print out contents of a lwp_t structure print_lwp_cred(lwp_t *lwpp) proc/cred.c print out contents of the LWP's credential structure print_proc(proc_t *p) proc/procsubr.c prints the contents of the specified process structure print_proc_cred(proc_t *procp) proc/cred.c print the contents of the proc's credential structure print_runque(runque_t *rqp) proc/disp.c print the contents of a runque_t structure Security Functions ------------------ < print_adt_bufctl, print_adt_logctl, print_adt_lvlctl, print_arecbuf, print_lwp_alwp, print_proc_aproc have been removed > STREAMS functions ----------------- print_dblk(dblk_t *dp) io/strsubr.c print a dblk_t structure print_leakcnt(void) io/stream.c If STRLEAK is defined this function counts how much memory is used by each function. Counts memory twice for dup'd messages. print_leaklist(void) io/stream.c If STRLEAK is defined this function dumps out all of the in-use messages print_linkinfo(struct linkinfo *li) io/strsubr.c print contents of linkinfo structure print_linkinfo_hash(void) io/strsubr.c dump contents of linkinfo_hash[] structure print_linkinfo_muxid(int muxid) io/strsubr.c print linkinfo structure for given muxid print_mblk(mblk_t *mp) io/strsubr.c print a mblk_t structure print_mux_edge(struct mux_edge *me) io/strsubr.c print a mux_edge structure and linkinfo structure for its muxid print_mux_node(struct mux_node *mn) io/strsubr.c print contents of mux_node structure and mux_edge and linkinfo structure. print_mux_nodes() io/strsubr.c call print_mux_nodes for all notes in mux_nodes[] print_queue(queue_t *qp) io/strsubr.c print contents of a queue structure Miscellaneous Functions ----------------------- print_cgarray(void) svc/sysinit.c print contents of the cg_array[] data structure print_config(void) svc/sysinit.c print system's CPU group related configuration. print_kernel_addrs(void) svc/sysinit.c print special kernel virtual addresses. print_pmem_list(struct pmem_extent *mnup) svc/memory.c prints out memory list. debug_details(char *funcname) util/debug.c prints details about a function, if available (from the optional field in dbgtools[]) debug_help(char *keyword) util/debug.c Prints all debug tool function descriptions which contain keyword A table of debug tool function descriptions is maintained in the file util/debug.c in the array dbgtools[]. This function can be used to find descriptions in that table. If the string, keyword, is found anywhere in the name, arguments, or description for a function, information on that function will be printed. The null string ("") will match all items. print_1_drv_list(drvlist_t *dlistp) util/mod/mod_drv.c prints modname, link, and info_p for given drvlist_t structure. print_cfg_info(cfg_info_t *cfgp) util/mod/mod_drv.c prints modname, resmgr key, idata, instance number, basedev and link information for cfg_info_t print_cfg_list(void) util/mod/mod_drv.c calls print_cfg_info() for each link in cfg_list[] print_drv_list(void) util/mod/mod_drv.c calls print_1_drv_list() for each link in drv_list[] print_engine(engine_t *engp) util/engine.c prints engine statistics print_putbuf(void) util/cmn_err.c prints putbuf as text. Console output is copied to putbuf[]. print_shim_list(void) util/mod/mod_ddishim.c prints name, ptr, type, and character major for all in shim_info_head list. print_static_modules(void) util/mod/modctl.c prints the list of modules statically linked into the kernel. print_test(void) util/cmn_err.c tests ability to print assorted data types. print_ws(void *structp, int type) io/ws/ws_subr.c prints the values of various data structures that are part of the integrated workstation environment. It takes two arguments: a data structure pointer whose fields are to be displayed and the data structure type. Following are the values of data structure type: 1 - wstation_t 2 - ws_channel_t 3 - vidstate_t 4 - termstate_t 5 - kbstate_t 6 - modeinfo 7 - xqInfo print_charstat(void *structp, int type) io/char/char.c prints the values of various data structures that are part of the integrated workstation environment. It takes two arguments: a data structure pointer whose fields are to be displayed and the data structure type. Following are the values of data structure type: 1 - charstat_t print_cmux(void *structp, int type) io/cmux/chanmux.c prints the values of various data structures that are part of the channel multiplexor. It takes two arguments: a data structure pointer whose fields are to be displayed and the data structure type. Following are the values of data structure type: 1 - cmux_ws_t 2 - cmux_link_t 3 - cmux_t 4 - cmux_lstrm_t 5 - w_cmuxpp (list of cmux_t)