diff --git a/sys/vm/uma.h b/sys/vm/uma.h --- a/sys/vm/uma.h +++ b/sys/vm/uma.h @@ -747,4 +747,19 @@ /* Return the amount of memory remaining. May be negative. */ long uma_avail(void); +/* + * Return the zone name string given to uma_zcreate(9) or its variants. + * + * The name may duplicate with any other zones. + */ +const char * uma_zone_name(const uma_zone_t zone); + +/* + * Similar to uma_zone_name() except that this returns the zone name string + * unique to each zone. + * + * The returned name is used by sysctl(3) to distinguish each zone. + */ +const char * uma_zone_unique_name(const uma_zone_t zone); + #endif /* _VM_UMA_H_ */ diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -5405,6 +5405,18 @@ return (uma_kmem_limit - uma_size()); } +/* See uma.h */ +const char * uma_zone_name(const uma_zone_t zone) +{ + return (zone->uz_name); +} + +/* See uma.h */ +const char * uma_zone_unique_name(const uma_zone_t zone) +{ + return (zone->uz_ctlname); +} + #ifdef DDB /* * Generate statistics across both the zone and its per-cpu cache's. Return