Page MenuHomeFreeBSD

D45378.id139133.diff
No OneTemporary

D45378.id139133.diff

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

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 3, 8:15 AM (13 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29178080
Default Alt Text
D45378.id139133.diff (1 KB)

Event Timeline