17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*8918dff3Sjwadams * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #include <mdb/mdb_modapi.h> 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #include <pthread.h> 327c478bd9Sstevel@tonic-gate #include <stddef.h> 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #include <libuutil.h> 357c478bd9Sstevel@tonic-gate #include <libuutil_impl.h> 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 387c478bd9Sstevel@tonic-gate static int 397c478bd9Sstevel@tonic-gate uutil_status(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) 407c478bd9Sstevel@tonic-gate { 417c478bd9Sstevel@tonic-gate pthread_t uu_panic_thread = 0; 427c478bd9Sstevel@tonic-gate 437c478bd9Sstevel@tonic-gate if ((flags & DCMD_ADDRSPEC) || argc != 0) 447c478bd9Sstevel@tonic-gate return (DCMD_USAGE); 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate if (mdb_readvar(&uu_panic_thread, "uu_panic_thread") == -1) { 477c478bd9Sstevel@tonic-gate mdb_warn("unable to read uu_panic_thread"); 487c478bd9Sstevel@tonic-gate } 497c478bd9Sstevel@tonic-gate 507c478bd9Sstevel@tonic-gate if (uu_panic_thread != 0) { 517c478bd9Sstevel@tonic-gate mdb_printf("thread %d uu_panicked\n", uu_panic_thread); 527c478bd9Sstevel@tonic-gate } 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate return (DCMD_OK); 557c478bd9Sstevel@tonic-gate } 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 587c478bd9Sstevel@tonic-gate static int 597c478bd9Sstevel@tonic-gate uutil_listpool(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) 607c478bd9Sstevel@tonic-gate { 617c478bd9Sstevel@tonic-gate uu_list_pool_t ulp; 627c478bd9Sstevel@tonic-gate 637c478bd9Sstevel@tonic-gate if (!(flags & DCMD_ADDRSPEC)) { 647c478bd9Sstevel@tonic-gate if (mdb_walk_dcmd("uu_list_pool", "uu_list_pool", argc, 657c478bd9Sstevel@tonic-gate argv) == -1) { 667c478bd9Sstevel@tonic-gate mdb_warn("can't walk uu_list_pool"); 677c478bd9Sstevel@tonic-gate return (DCMD_ERR); 687c478bd9Sstevel@tonic-gate } 697c478bd9Sstevel@tonic-gate return (DCMD_OK); 707c478bd9Sstevel@tonic-gate } 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gate if (argc != 0) 737c478bd9Sstevel@tonic-gate return (DCMD_USAGE); 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate if (DCMD_HDRSPEC(flags)) 767c478bd9Sstevel@tonic-gate mdb_printf("%-?s %-30s %?s %5s\n", 777c478bd9Sstevel@tonic-gate "ADDR", "NAME", "COMPARE", "FLAGS"); 787c478bd9Sstevel@tonic-gate 797c478bd9Sstevel@tonic-gate if (mdb_vread(&ulp, sizeof (uu_list_pool_t), addr) == -1) { 807c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list_pool\n"); 817c478bd9Sstevel@tonic-gate return (DCMD_ERR); 827c478bd9Sstevel@tonic-gate } 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate mdb_printf("%0?p %-30s %08x %c\n", addr, ulp.ulp_name, ulp.ulp_cmp, 857c478bd9Sstevel@tonic-gate ulp.ulp_debug ? 'D' : ' '); 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate return (DCMD_OK); 887c478bd9Sstevel@tonic-gate } 897c478bd9Sstevel@tonic-gate 907c478bd9Sstevel@tonic-gate /*ARGSUSED*/ 917c478bd9Sstevel@tonic-gate static int 927c478bd9Sstevel@tonic-gate uutil_list(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv) 937c478bd9Sstevel@tonic-gate { 947c478bd9Sstevel@tonic-gate uu_list_t ul; 957c478bd9Sstevel@tonic-gate 967c478bd9Sstevel@tonic-gate if (!(flags & DCMD_ADDRSPEC) || argc != 0) 977c478bd9Sstevel@tonic-gate return (DCMD_USAGE); 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gate if (mdb_vread(&ul, sizeof (uu_list_t), addr) == -1) { 1007c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list\n"); 1017c478bd9Sstevel@tonic-gate return (DCMD_ERR); 1027c478bd9Sstevel@tonic-gate } 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate if (DCMD_HDRSPEC(flags)) 1057c478bd9Sstevel@tonic-gate mdb_printf("%-?s %-?s %-?s %6s %5s\n", 1067c478bd9Sstevel@tonic-gate "ADDR", "POOL", "PARENT", "NODES", "FLAGS"); 1077c478bd9Sstevel@tonic-gate 1087c478bd9Sstevel@tonic-gate mdb_printf("%0?p %0?p %0?p %6u %c%c\n", 109*8918dff3Sjwadams addr, ul.ul_pool, UU_PTR_DECODE(ul.ul_parent_enc), 110*8918dff3Sjwadams ul.ul_numnodes, ul.ul_sorted ? 'S' : ' ', ul.ul_debug? 'D' : ' '); 1117c478bd9Sstevel@tonic-gate 1127c478bd9Sstevel@tonic-gate return (DCMD_OK); 1137c478bd9Sstevel@tonic-gate } 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate typedef struct uutil_listpool_walk { 1167c478bd9Sstevel@tonic-gate uintptr_t ulpw_final; 1177c478bd9Sstevel@tonic-gate uintptr_t ulpw_current; 1187c478bd9Sstevel@tonic-gate } uutil_listpool_walk_t; 1197c478bd9Sstevel@tonic-gate 1207c478bd9Sstevel@tonic-gate int 1217c478bd9Sstevel@tonic-gate uutil_listpool_walk_init(mdb_walk_state_t *wsp) 1227c478bd9Sstevel@tonic-gate { 1237c478bd9Sstevel@tonic-gate uu_list_pool_t null_lpool; 1247c478bd9Sstevel@tonic-gate uutil_listpool_walk_t *ulpw; 1257c478bd9Sstevel@tonic-gate GElf_Sym sym; 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gate bzero(&null_lpool, sizeof (uu_list_pool_t)); 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate if (mdb_lookup_by_obj("libuutil.so.1", "uu_null_lpool", &sym) == 1307c478bd9Sstevel@tonic-gate -1) { 1317c478bd9Sstevel@tonic-gate mdb_warn("failed to find 'uu_null_lpool'\n"); 1327c478bd9Sstevel@tonic-gate return (WALK_ERR); 1337c478bd9Sstevel@tonic-gate } 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate if (mdb_vread(&null_lpool, sym.st_size, (uintptr_t)sym.st_value) == 1367c478bd9Sstevel@tonic-gate -1) { 1377c478bd9Sstevel@tonic-gate mdb_warn("failed to read data from 'uu_null_lpool' address\n"); 1387c478bd9Sstevel@tonic-gate return (WALK_ERR); 1397c478bd9Sstevel@tonic-gate } 1407c478bd9Sstevel@tonic-gate 1417c478bd9Sstevel@tonic-gate ulpw = mdb_alloc(sizeof (uutil_listpool_walk_t), UM_SLEEP); 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate ulpw->ulpw_final = (uintptr_t)null_lpool.ulp_prev; 1447c478bd9Sstevel@tonic-gate ulpw->ulpw_current = (uintptr_t)null_lpool.ulp_next; 1457c478bd9Sstevel@tonic-gate wsp->walk_data = ulpw; 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gate return (WALK_NEXT); 1487c478bd9Sstevel@tonic-gate } 1497c478bd9Sstevel@tonic-gate 1507c478bd9Sstevel@tonic-gate int 1517c478bd9Sstevel@tonic-gate uutil_listpool_walk_step(mdb_walk_state_t *wsp) 1527c478bd9Sstevel@tonic-gate { 1537c478bd9Sstevel@tonic-gate uu_list_pool_t ulp; 1547c478bd9Sstevel@tonic-gate uutil_listpool_walk_t *ulpw = wsp->walk_data; 1557c478bd9Sstevel@tonic-gate int status; 1567c478bd9Sstevel@tonic-gate 1577c478bd9Sstevel@tonic-gate if (mdb_vread(&ulp, sizeof (uu_list_pool_t), 1587c478bd9Sstevel@tonic-gate ulpw->ulpw_current) == -1) { 1597c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list_pool %x", ulpw->ulpw_current); 1607c478bd9Sstevel@tonic-gate return (WALK_ERR); 1617c478bd9Sstevel@tonic-gate } 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate status = wsp->walk_callback(ulpw->ulpw_current, &ulp, wsp->walk_cbdata); 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gate if (ulpw->ulpw_current == ulpw->ulpw_final) 1667c478bd9Sstevel@tonic-gate return (WALK_DONE); 1677c478bd9Sstevel@tonic-gate 1687c478bd9Sstevel@tonic-gate ulpw->ulpw_current = (uintptr_t)ulp.ulp_next; 1697c478bd9Sstevel@tonic-gate 1707c478bd9Sstevel@tonic-gate return (status); 1717c478bd9Sstevel@tonic-gate } 1727c478bd9Sstevel@tonic-gate 1737c478bd9Sstevel@tonic-gate void 1747c478bd9Sstevel@tonic-gate uutil_listpool_walk_fini(mdb_walk_state_t *wsp) 1757c478bd9Sstevel@tonic-gate { 1767c478bd9Sstevel@tonic-gate uutil_listpool_walk_t *ulpw = wsp->walk_data; 1777c478bd9Sstevel@tonic-gate mdb_free(ulpw, sizeof (uutil_listpool_walk_t)); 1787c478bd9Sstevel@tonic-gate } 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate typedef struct uutil_list_walk { 1817c478bd9Sstevel@tonic-gate uintptr_t ulw_final; 1827c478bd9Sstevel@tonic-gate uintptr_t ulw_current; 1837c478bd9Sstevel@tonic-gate } uutil_list_walk_t; 1847c478bd9Sstevel@tonic-gate 1857c478bd9Sstevel@tonic-gate int 1867c478bd9Sstevel@tonic-gate uutil_list_walk_init(mdb_walk_state_t *wsp) 1877c478bd9Sstevel@tonic-gate { 1887c478bd9Sstevel@tonic-gate uutil_list_walk_t *ulw; 1897c478bd9Sstevel@tonic-gate uu_list_pool_t ulp; 1907c478bd9Sstevel@tonic-gate 1917c478bd9Sstevel@tonic-gate if (mdb_vread(&ulp, sizeof (uu_list_pool_t), wsp->walk_addr) == -1) { 1927c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list_pool_t at given address\n"); 1937c478bd9Sstevel@tonic-gate return (WALK_ERR); 1947c478bd9Sstevel@tonic-gate } 1957c478bd9Sstevel@tonic-gate 196*8918dff3Sjwadams if (UU_LIST_PTR(ulp.ulp_null_list.ul_next_enc) == 197*8918dff3Sjwadams &((uu_list_pool_t *)wsp->walk_addr)->ulp_null_list) 198*8918dff3Sjwadams return (WALK_DONE); 199*8918dff3Sjwadams 2007c478bd9Sstevel@tonic-gate ulw = mdb_alloc(sizeof (uutil_list_walk_t), UM_SLEEP); 2017c478bd9Sstevel@tonic-gate 202*8918dff3Sjwadams ulw->ulw_final = (uintptr_t)UU_LIST_PTR(ulp.ulp_null_list.ul_prev_enc); 203*8918dff3Sjwadams ulw->ulw_current = 204*8918dff3Sjwadams (uintptr_t)UU_LIST_PTR(ulp.ulp_null_list.ul_next_enc); 2057c478bd9Sstevel@tonic-gate wsp->walk_data = ulw; 2067c478bd9Sstevel@tonic-gate 2077c478bd9Sstevel@tonic-gate return (WALK_NEXT); 2087c478bd9Sstevel@tonic-gate } 2097c478bd9Sstevel@tonic-gate 2107c478bd9Sstevel@tonic-gate int 2117c478bd9Sstevel@tonic-gate uutil_list_walk_step(mdb_walk_state_t *wsp) 2127c478bd9Sstevel@tonic-gate { 2137c478bd9Sstevel@tonic-gate uu_list_t ul; 2147c478bd9Sstevel@tonic-gate uutil_list_walk_t *ulw = wsp->walk_data; 2157c478bd9Sstevel@tonic-gate int status; 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate if (mdb_vread(&ul, sizeof (uu_list_t), ulw->ulw_current) == -1) { 2187c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list %x", ulw->ulw_current); 2197c478bd9Sstevel@tonic-gate return (WALK_ERR); 2207c478bd9Sstevel@tonic-gate } 2217c478bd9Sstevel@tonic-gate 2227c478bd9Sstevel@tonic-gate status = wsp->walk_callback(ulw->ulw_current, &ul, wsp->walk_cbdata); 2237c478bd9Sstevel@tonic-gate 2247c478bd9Sstevel@tonic-gate if (ulw->ulw_current == ulw->ulw_final) 2257c478bd9Sstevel@tonic-gate return (WALK_DONE); 2267c478bd9Sstevel@tonic-gate 227*8918dff3Sjwadams ulw->ulw_current = (uintptr_t)UU_LIST_PTR(ul.ul_next_enc); 2287c478bd9Sstevel@tonic-gate 2297c478bd9Sstevel@tonic-gate return (status); 2307c478bd9Sstevel@tonic-gate } 2317c478bd9Sstevel@tonic-gate 2327c478bd9Sstevel@tonic-gate void 2337c478bd9Sstevel@tonic-gate uutil_list_walk_fini(mdb_walk_state_t *wsp) 2347c478bd9Sstevel@tonic-gate { 2357c478bd9Sstevel@tonic-gate uutil_list_walk_t *ulw = wsp->walk_data; 2367c478bd9Sstevel@tonic-gate mdb_free(ulw, sizeof (uutil_list_walk_t)); 2377c478bd9Sstevel@tonic-gate } 2387c478bd9Sstevel@tonic-gate 2397c478bd9Sstevel@tonic-gate typedef struct uutil_list_node_walk { 2407c478bd9Sstevel@tonic-gate size_t ulnw_offset; 2417c478bd9Sstevel@tonic-gate uintptr_t ulnw_final; 2427c478bd9Sstevel@tonic-gate uintptr_t ulnw_current; 2437c478bd9Sstevel@tonic-gate void *ulnw_buf; 2447c478bd9Sstevel@tonic-gate size_t ulnw_bufsz; 2457c478bd9Sstevel@tonic-gate } uutil_list_node_walk_t; 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate int 2487c478bd9Sstevel@tonic-gate uutil_list_node_walk_init(mdb_walk_state_t *wsp) 2497c478bd9Sstevel@tonic-gate { 2507c478bd9Sstevel@tonic-gate uutil_list_node_walk_t *ulnw; 2517c478bd9Sstevel@tonic-gate uu_list_t ul; 2527c478bd9Sstevel@tonic-gate uu_list_pool_t ulp; 2537c478bd9Sstevel@tonic-gate 2547c478bd9Sstevel@tonic-gate if (mdb_vread(&ul, sizeof (uu_list_t), wsp->walk_addr) == -1) { 2557c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list_t at given address\n"); 2567c478bd9Sstevel@tonic-gate return (WALK_ERR); 2577c478bd9Sstevel@tonic-gate } 2587c478bd9Sstevel@tonic-gate 2597c478bd9Sstevel@tonic-gate if (mdb_vread(&ulp, sizeof (uu_list_pool_t), (uintptr_t)ul.ul_pool) == 2607c478bd9Sstevel@tonic-gate -1) { 2617c478bd9Sstevel@tonic-gate mdb_warn("failed to read supporting uu_list_pool_t\n"); 2627c478bd9Sstevel@tonic-gate return (WALK_ERR); 2637c478bd9Sstevel@tonic-gate } 2647c478bd9Sstevel@tonic-gate 2657c478bd9Sstevel@tonic-gate ulnw = mdb_alloc(sizeof (uutil_list_node_walk_t), UM_SLEEP); 2667c478bd9Sstevel@tonic-gate 2677c478bd9Sstevel@tonic-gate ulnw->ulnw_offset = ul.ul_offset; 2687c478bd9Sstevel@tonic-gate ulnw->ulnw_final = wsp->walk_addr + offsetof(uu_list_t, ul_null_node); 2697c478bd9Sstevel@tonic-gate ulnw->ulnw_current = (uintptr_t)ul.ul_null_node.uln_next; 2707c478bd9Sstevel@tonic-gate ulnw->ulnw_buf = mdb_alloc(ulp.ulp_objsize, UM_SLEEP); 2717c478bd9Sstevel@tonic-gate ulnw->ulnw_bufsz = ulp.ulp_objsize; 2727c478bd9Sstevel@tonic-gate 2737c478bd9Sstevel@tonic-gate wsp->walk_data = ulnw; 2747c478bd9Sstevel@tonic-gate 2757c478bd9Sstevel@tonic-gate return (WALK_NEXT); 2767c478bd9Sstevel@tonic-gate } 2777c478bd9Sstevel@tonic-gate 2787c478bd9Sstevel@tonic-gate int 2797c478bd9Sstevel@tonic-gate uutil_list_node_walk_step(mdb_walk_state_t *wsp) 2807c478bd9Sstevel@tonic-gate { 2817c478bd9Sstevel@tonic-gate uu_list_node_impl_t uln; 2827c478bd9Sstevel@tonic-gate uutil_list_node_walk_t *ulnw = wsp->walk_data; 2837c478bd9Sstevel@tonic-gate int status; 2847c478bd9Sstevel@tonic-gate uintptr_t diff; 2857c478bd9Sstevel@tonic-gate 2867c478bd9Sstevel@tonic-gate if (ulnw->ulnw_current == ulnw->ulnw_final) 2877c478bd9Sstevel@tonic-gate return (WALK_DONE); 2887c478bd9Sstevel@tonic-gate 2897c478bd9Sstevel@tonic-gate if (mdb_vread(&uln, sizeof (uu_list_node_impl_t), ulnw->ulnw_current) == 2907c478bd9Sstevel@tonic-gate -1) { 2917c478bd9Sstevel@tonic-gate mdb_warn("failed to read uu_list_node %x", ulnw->ulnw_current); 2927c478bd9Sstevel@tonic-gate return (WALK_ERR); 2937c478bd9Sstevel@tonic-gate } 2947c478bd9Sstevel@tonic-gate 2957c478bd9Sstevel@tonic-gate diff = ulnw->ulnw_current - ulnw->ulnw_offset; 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gate if (mdb_vread(ulnw->ulnw_buf, ulnw->ulnw_bufsz, diff) == -1) { 2987c478bd9Sstevel@tonic-gate mdb_warn("failed to read enclosing structure %x", diff); 2997c478bd9Sstevel@tonic-gate return (WALK_ERR); 3007c478bd9Sstevel@tonic-gate } 3017c478bd9Sstevel@tonic-gate /* 3027c478bd9Sstevel@tonic-gate * Correct for offset; we return the address of the included structure. 3037c478bd9Sstevel@tonic-gate */ 3047c478bd9Sstevel@tonic-gate status = wsp->walk_callback(diff, ulnw->ulnw_buf, wsp->walk_cbdata); 3057c478bd9Sstevel@tonic-gate 3067c478bd9Sstevel@tonic-gate ulnw->ulnw_current = (uintptr_t)uln.uln_next; 3077c478bd9Sstevel@tonic-gate 3087c478bd9Sstevel@tonic-gate return (status); 3097c478bd9Sstevel@tonic-gate } 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate void 3127c478bd9Sstevel@tonic-gate uutil_list_node_walk_fini(mdb_walk_state_t *wsp) 3137c478bd9Sstevel@tonic-gate { 3147c478bd9Sstevel@tonic-gate uutil_list_node_walk_t *ulnw = wsp->walk_data; 3157c478bd9Sstevel@tonic-gate 3167c478bd9Sstevel@tonic-gate mdb_free(ulnw->ulnw_buf, ulnw->ulnw_bufsz); 3177c478bd9Sstevel@tonic-gate mdb_free(ulnw, sizeof (uutil_list_node_walk_t)); 3187c478bd9Sstevel@tonic-gate } 3197c478bd9Sstevel@tonic-gate 3207c478bd9Sstevel@tonic-gate static const mdb_dcmd_t dcmds[] = { 3217c478bd9Sstevel@tonic-gate { "uutil_status", NULL, "libuutil status summary", uutil_status }, 3227c478bd9Sstevel@tonic-gate { "uu_list_pool", NULL, "display uu_list_pool information", 3237c478bd9Sstevel@tonic-gate uutil_listpool }, 3247c478bd9Sstevel@tonic-gate { "uu_list", NULL, "display uu_list information", 3257c478bd9Sstevel@tonic-gate uutil_list }, 3267c478bd9Sstevel@tonic-gate { NULL } 3277c478bd9Sstevel@tonic-gate }; 3287c478bd9Sstevel@tonic-gate 3297c478bd9Sstevel@tonic-gate static const mdb_walker_t walkers[] = { 3307c478bd9Sstevel@tonic-gate { "uu_list_pool", "walk uu_list_pools", 3317c478bd9Sstevel@tonic-gate uutil_listpool_walk_init, uutil_listpool_walk_step, 3327c478bd9Sstevel@tonic-gate uutil_listpool_walk_fini }, 3337c478bd9Sstevel@tonic-gate { "uu_list", "given a uu_list_pool, walk its uu_lists", 3347c478bd9Sstevel@tonic-gate uutil_list_walk_init, uutil_list_walk_step, 3357c478bd9Sstevel@tonic-gate uutil_list_walk_fini }, 3367c478bd9Sstevel@tonic-gate { "uu_list_node", 3377c478bd9Sstevel@tonic-gate "given a uu_list, walk its nodes, returning container addr", 3387c478bd9Sstevel@tonic-gate uutil_list_node_walk_init, uutil_list_node_walk_step, 3397c478bd9Sstevel@tonic-gate uutil_list_node_walk_fini }, 3407c478bd9Sstevel@tonic-gate { NULL } 3417c478bd9Sstevel@tonic-gate }; 3427c478bd9Sstevel@tonic-gate 3437c478bd9Sstevel@tonic-gate static const mdb_modinfo_t modinfo = { 3447c478bd9Sstevel@tonic-gate MDB_API_VERSION, dcmds, walkers 3457c478bd9Sstevel@tonic-gate }; 3467c478bd9Sstevel@tonic-gate 3477c478bd9Sstevel@tonic-gate const mdb_modinfo_t * 3487c478bd9Sstevel@tonic-gate _mdb_init(void) 3497c478bd9Sstevel@tonic-gate { 3507c478bd9Sstevel@tonic-gate return (&modinfo); 3517c478bd9Sstevel@tonic-gate } 352