10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*1528Sjwadams * Common Development and Distribution License (the "License"). 6*1528Sjwadams * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 210Sstevel@tonic-gate /* 22*1528Sjwadams * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 230Sstevel@tonic-gate * Use is subject to license terms. 240Sstevel@tonic-gate */ 250Sstevel@tonic-gate 260Sstevel@tonic-gate #ifndef _MDBMOD_UMEM_H 270Sstevel@tonic-gate #define _MDBMOD_UMEM_H 280Sstevel@tonic-gate 290Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 300Sstevel@tonic-gate 310Sstevel@tonic-gate #include <mdb/mdb_modapi.h> 320Sstevel@tonic-gate #include <umem_impl.h> 330Sstevel@tonic-gate 340Sstevel@tonic-gate #ifdef __cplusplus 350Sstevel@tonic-gate extern "C" { 360Sstevel@tonic-gate #endif 370Sstevel@tonic-gate 38*1528Sjwadams extern int umem_ready; 390Sstevel@tonic-gate extern uint32_t umem_stack_depth; 400Sstevel@tonic-gate 410Sstevel@tonic-gate extern int umem_cache_walk_init(mdb_walk_state_t *); 420Sstevel@tonic-gate extern int umem_cache_walk_step(mdb_walk_state_t *); 430Sstevel@tonic-gate extern void umem_cache_walk_fini(mdb_walk_state_t *); 440Sstevel@tonic-gate 450Sstevel@tonic-gate extern int umem_cpu_walk_init(mdb_walk_state_t *); 460Sstevel@tonic-gate extern int umem_cpu_walk_step(mdb_walk_state_t *); 470Sstevel@tonic-gate extern void umem_cpu_walk_fini(mdb_walk_state_t *); 480Sstevel@tonic-gate 490Sstevel@tonic-gate extern int umem_cpu_cache_walk_init(mdb_walk_state_t *); 500Sstevel@tonic-gate extern int umem_cpu_cache_walk_step(mdb_walk_state_t *); 510Sstevel@tonic-gate 520Sstevel@tonic-gate extern int umem_slab_walk_init(mdb_walk_state_t *); 530Sstevel@tonic-gate extern int umem_slab_walk_partial_init(mdb_walk_state_t *); 540Sstevel@tonic-gate extern int umem_slab_walk_step(mdb_walk_state_t *); 550Sstevel@tonic-gate 560Sstevel@tonic-gate extern int umem_hash_walk_init(mdb_walk_state_t *wsp); 570Sstevel@tonic-gate extern int umem_hash_walk_step(mdb_walk_state_t *wsp); 580Sstevel@tonic-gate extern void umem_hash_walk_fini(mdb_walk_state_t *wsp); 590Sstevel@tonic-gate 600Sstevel@tonic-gate extern int umem_walk_init(mdb_walk_state_t *); 610Sstevel@tonic-gate extern int bufctl_walk_init(mdb_walk_state_t *); 620Sstevel@tonic-gate extern int freemem_walk_init(mdb_walk_state_t *); 630Sstevel@tonic-gate extern int freectl_walk_init(mdb_walk_state_t *); 640Sstevel@tonic-gate 650Sstevel@tonic-gate extern int umem_walk_step(mdb_walk_state_t *); 660Sstevel@tonic-gate extern void umem_walk_fini(mdb_walk_state_t *); 670Sstevel@tonic-gate 680Sstevel@tonic-gate extern int bufctl_history_walk_init(mdb_walk_state_t *); 690Sstevel@tonic-gate extern int bufctl_history_walk_step(mdb_walk_state_t *); 700Sstevel@tonic-gate extern void bufctl_history_walk_fini(mdb_walk_state_t *); 710Sstevel@tonic-gate 720Sstevel@tonic-gate extern int allocdby_walk_init(mdb_walk_state_t *); 730Sstevel@tonic-gate extern int allocdby_walk_step(mdb_walk_state_t *); 740Sstevel@tonic-gate extern void allocdby_walk_fini(mdb_walk_state_t *); 750Sstevel@tonic-gate 760Sstevel@tonic-gate extern int freedby_walk_init(mdb_walk_state_t *); 770Sstevel@tonic-gate extern int freedby_walk_step(mdb_walk_state_t *); 780Sstevel@tonic-gate extern void freedby_walk_fini(mdb_walk_state_t *); 790Sstevel@tonic-gate 800Sstevel@tonic-gate extern int umem_log_walk_init(mdb_walk_state_t *); 810Sstevel@tonic-gate extern int umem_log_walk_step(mdb_walk_state_t *); 820Sstevel@tonic-gate extern void umem_log_walk_fini(mdb_walk_state_t *); 830Sstevel@tonic-gate 840Sstevel@tonic-gate extern int allocdby_walk_init(mdb_walk_state_t *); 850Sstevel@tonic-gate extern int allocdby_walk_step(mdb_walk_state_t *); 860Sstevel@tonic-gate extern void allocdby_walk_fini(mdb_walk_state_t *); 870Sstevel@tonic-gate 880Sstevel@tonic-gate extern int freedby_walk_init(mdb_walk_state_t *); 890Sstevel@tonic-gate extern int freedby_walk_step(mdb_walk_state_t *); 900Sstevel@tonic-gate extern void freedby_walk_fini(mdb_walk_state_t *); 910Sstevel@tonic-gate 920Sstevel@tonic-gate extern int vmem_walk_init(mdb_walk_state_t *); 930Sstevel@tonic-gate extern int vmem_walk_step(mdb_walk_state_t *); 940Sstevel@tonic-gate extern void vmem_walk_fini(mdb_walk_state_t *); 950Sstevel@tonic-gate 960Sstevel@tonic-gate extern int vmem_postfix_walk_step(mdb_walk_state_t *); 970Sstevel@tonic-gate 980Sstevel@tonic-gate extern int vmem_seg_walk_init(mdb_walk_state_t *); 990Sstevel@tonic-gate extern int vmem_seg_walk_step(mdb_walk_state_t *); 1000Sstevel@tonic-gate extern void vmem_seg_walk_fini(mdb_walk_state_t *); 1010Sstevel@tonic-gate 1020Sstevel@tonic-gate extern int vmem_span_walk_init(mdb_walk_state_t *); 1030Sstevel@tonic-gate extern int vmem_alloc_walk_init(mdb_walk_state_t *); 1040Sstevel@tonic-gate extern int vmem_free_walk_init(mdb_walk_state_t *); 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate extern int allocdby(uintptr_t, uint_t, int, const mdb_arg_t *); 1070Sstevel@tonic-gate extern int bufctl(uintptr_t, uint_t, int, const mdb_arg_t *); 1080Sstevel@tonic-gate extern int bufctl_audit(uintptr_t, uint_t, int, const mdb_arg_t *); 1090Sstevel@tonic-gate extern int freedby(uintptr_t, uint_t, int, const mdb_arg_t *); 1100Sstevel@tonic-gate extern int umalog(uintptr_t, uint_t, int, const mdb_arg_t *); 1110Sstevel@tonic-gate extern int umausers(uintptr_t, uint_t, int, const mdb_arg_t *); 1120Sstevel@tonic-gate extern int umem_cache(uintptr_t, uint_t, int, const mdb_arg_t *); 1130Sstevel@tonic-gate extern int umem_log(uintptr_t, uint_t, int, const mdb_arg_t *); 114*1528Sjwadams extern int umem_malloc_dist(uintptr_t, uint_t, int, const mdb_arg_t *); 115*1528Sjwadams extern int umem_malloc_info(uintptr_t, uint_t, int, const mdb_arg_t *); 1160Sstevel@tonic-gate extern int umem_status(uintptr_t, uint_t, int, const mdb_arg_t *); 1170Sstevel@tonic-gate extern int umem_verify(uintptr_t, uint_t, int, const mdb_arg_t *); 1180Sstevel@tonic-gate extern int umem_verify_alloc(uintptr_t, uint_t, int, const mdb_arg_t *); 1190Sstevel@tonic-gate extern int umem_verify_free(uintptr_t, uint_t, int, const mdb_arg_t *); 1200Sstevel@tonic-gate extern int vmem(uintptr_t, uint_t, int, const mdb_arg_t *); 1210Sstevel@tonic-gate extern int vmem_seg(uintptr_t, uint_t, int, const mdb_arg_t *); 1220Sstevel@tonic-gate extern int whatis(uintptr_t, uint_t, int, const mdb_arg_t *); 123*1528Sjwadams 1240Sstevel@tonic-gate extern void bufctl_help(void); 125*1528Sjwadams extern void umem_malloc_dist_help(void); 126*1528Sjwadams extern void umem_malloc_info_help(void); 1270Sstevel@tonic-gate extern void vmem_seg_help(void); 1280Sstevel@tonic-gate 1290Sstevel@tonic-gate /* 1300Sstevel@tonic-gate * utility functions for the rest of libumem 1310Sstevel@tonic-gate */ 1320Sstevel@tonic-gate extern int umem_init(void); 1330Sstevel@tonic-gate extern int umem_get_magsize(const umem_cache_t *); 1340Sstevel@tonic-gate extern size_t umem_estimate_allocated(uintptr_t, const umem_cache_t *); 1350Sstevel@tonic-gate 1360Sstevel@tonic-gate #ifdef __cplusplus 1370Sstevel@tonic-gate } 1380Sstevel@tonic-gate #endif 1390Sstevel@tonic-gate 1400Sstevel@tonic-gate #endif /* _MDBMOD_UMEM_H */ 141