1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23 * Use is subject to license terms. 24 */ 25 26 #ifndef _MDBMOD_UMEM_H 27 #define _MDBMOD_UMEM_H 28 29 #include <mdb/mdb_modapi.h> 30 #include <umem_impl.h> 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 extern int umem_ready; 37 extern uint32_t umem_stack_depth; 38 39 extern int umem_cache_walk_init(mdb_walk_state_t *); 40 extern int umem_cache_walk_step(mdb_walk_state_t *); 41 extern void umem_cache_walk_fini(mdb_walk_state_t *); 42 43 extern int umem_cpu_walk_init(mdb_walk_state_t *); 44 extern int umem_cpu_walk_step(mdb_walk_state_t *); 45 extern void umem_cpu_walk_fini(mdb_walk_state_t *); 46 47 extern int umem_cpu_cache_walk_init(mdb_walk_state_t *); 48 extern int umem_cpu_cache_walk_step(mdb_walk_state_t *); 49 50 extern int umem_slab_walk_init(mdb_walk_state_t *); 51 extern int umem_slab_walk_partial_init(mdb_walk_state_t *); 52 extern int umem_slab_walk_step(mdb_walk_state_t *); 53 54 extern int umem_hash_walk_init(mdb_walk_state_t *wsp); 55 extern int umem_hash_walk_step(mdb_walk_state_t *wsp); 56 extern void umem_hash_walk_fini(mdb_walk_state_t *wsp); 57 58 extern int umem_walk_init(mdb_walk_state_t *); 59 extern int bufctl_walk_init(mdb_walk_state_t *); 60 extern int freemem_walk_init(mdb_walk_state_t *); 61 extern int freectl_walk_init(mdb_walk_state_t *); 62 63 extern int umem_walk_step(mdb_walk_state_t *); 64 extern void umem_walk_fini(mdb_walk_state_t *); 65 66 extern int bufctl_history_walk_init(mdb_walk_state_t *); 67 extern int bufctl_history_walk_step(mdb_walk_state_t *); 68 extern void bufctl_history_walk_fini(mdb_walk_state_t *); 69 70 extern int allocdby_walk_init(mdb_walk_state_t *); 71 extern int allocdby_walk_step(mdb_walk_state_t *); 72 extern void allocdby_walk_fini(mdb_walk_state_t *); 73 74 extern int freedby_walk_init(mdb_walk_state_t *); 75 extern int freedby_walk_step(mdb_walk_state_t *); 76 extern void freedby_walk_fini(mdb_walk_state_t *); 77 78 extern int umem_log_walk_init(mdb_walk_state_t *); 79 extern int umem_log_walk_step(mdb_walk_state_t *); 80 extern void umem_log_walk_fini(mdb_walk_state_t *); 81 82 extern int allocdby_walk_init(mdb_walk_state_t *); 83 extern int allocdby_walk_step(mdb_walk_state_t *); 84 extern void allocdby_walk_fini(mdb_walk_state_t *); 85 86 extern int freedby_walk_init(mdb_walk_state_t *); 87 extern int freedby_walk_step(mdb_walk_state_t *); 88 extern void freedby_walk_fini(mdb_walk_state_t *); 89 90 extern int vmem_walk_init(mdb_walk_state_t *); 91 extern int vmem_walk_step(mdb_walk_state_t *); 92 extern void vmem_walk_fini(mdb_walk_state_t *); 93 94 extern int vmem_postfix_walk_step(mdb_walk_state_t *); 95 96 extern int vmem_seg_walk_init(mdb_walk_state_t *); 97 extern int vmem_seg_walk_step(mdb_walk_state_t *); 98 extern void vmem_seg_walk_fini(mdb_walk_state_t *); 99 100 extern int vmem_span_walk_init(mdb_walk_state_t *); 101 extern int vmem_alloc_walk_init(mdb_walk_state_t *); 102 extern int vmem_free_walk_init(mdb_walk_state_t *); 103 104 extern int allocdby(uintptr_t, uint_t, int, const mdb_arg_t *); 105 extern int bufctl(uintptr_t, uint_t, int, const mdb_arg_t *); 106 extern int bufctl_audit(uintptr_t, uint_t, int, const mdb_arg_t *); 107 extern int freedby(uintptr_t, uint_t, int, const mdb_arg_t *); 108 extern int umalog(uintptr_t, uint_t, int, const mdb_arg_t *); 109 extern int umausers(uintptr_t, uint_t, int, const mdb_arg_t *); 110 extern int umem_cache(uintptr_t, uint_t, int, const mdb_arg_t *); 111 extern int umem_log(uintptr_t, uint_t, int, const mdb_arg_t *); 112 extern int umem_malloc_dist(uintptr_t, uint_t, int, const mdb_arg_t *); 113 extern int umem_malloc_info(uintptr_t, uint_t, int, const mdb_arg_t *); 114 extern int umem_status(uintptr_t, uint_t, int, const mdb_arg_t *); 115 extern int umem_verify(uintptr_t, uint_t, int, const mdb_arg_t *); 116 extern int umem_verify_alloc(uintptr_t, uint_t, int, const mdb_arg_t *); 117 extern int umem_verify_free(uintptr_t, uint_t, int, const mdb_arg_t *); 118 extern int vmem(uintptr_t, uint_t, int, const mdb_arg_t *); 119 extern int vmem_seg(uintptr_t, uint_t, int, const mdb_arg_t *); 120 extern int whatis(uintptr_t, uint_t, int, const mdb_arg_t *); 121 122 extern void bufctl_help(void); 123 extern void umem_malloc_dist_help(void); 124 extern void umem_malloc_info_help(void); 125 extern void vmem_seg_help(void); 126 127 /* 128 * utility functions for the rest of libumem 129 */ 130 extern int umem_init(void); 131 extern int umem_get_magsize(const umem_cache_t *); 132 extern size_t umem_estimate_allocated(uintptr_t, const umem_cache_t *); 133 134 #ifdef __cplusplus 135 } 136 #endif 137 138 #endif /* _MDBMOD_UMEM_H */ 139