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