Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142669717
D22748.id65486.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D22748.id65486.diff
View Options
Index: head/sys/vm/uma_core.c
===================================================================
--- head/sys/vm/uma_core.c
+++ head/sys/vm/uma_core.c
@@ -289,6 +289,7 @@
static int sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS);
static int sysctl_handle_uma_zone_allocs(SYSCTL_HANDLER_ARGS);
static int sysctl_handle_uma_zone_frees(SYSCTL_HANDLER_ARGS);
+static int sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS);
#ifdef INVARIANTS
static bool uma_dbg_kskip(uma_keg_t keg, void *mem);
@@ -1896,8 +1897,9 @@
oid = zone->uz_oid;
SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"size", CTLFLAG_RD, &zone->uz_size, 0, "Allocation size");
- SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
- "flags", CTLFLAG_RD, &zone->uz_flags, 0,
+ SYSCTL_ADD_PROC(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
+ "flags", CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_MPSAFE,
+ zone, 0, sysctl_handle_uma_zone_flags, "A",
"Allocator configuration flags");
SYSCTL_ADD_U16(NULL, SYSCTL_CHILDREN(oid), OID_AUTO,
"bucket_size", CTLFLAG_RD, &zone->uz_bucket_size, 0,
@@ -4406,6 +4408,24 @@
cur = uma_zone_get_frees(zone);
return (sysctl_handle_64(oidp, &cur, 0, req));
+}
+
+static int
+sysctl_handle_uma_zone_flags(SYSCTL_HANDLER_ARGS)
+{
+ struct sbuf sbuf;
+ uma_zone_t zone = arg1;
+ int error;
+
+ sbuf_new_for_sysctl(&sbuf, NULL, 0, req);
+ if (zone->uz_flags != 0)
+ sbuf_printf(&sbuf, "0x%b", zone->uz_flags, PRINT_UMA_ZFLAGS);
+ else
+ sbuf_printf(&sbuf, "0");
+ error = sbuf_finish(&sbuf);
+ sbuf_delete(&sbuf);
+
+ return (error);
}
#ifdef INVARIANTS
Index: head/sys/vm/uma_int.h
===================================================================
--- head/sys/vm/uma_int.h
+++ head/sys/vm/uma_int.h
@@ -420,6 +420,32 @@
#define UMA_ZFLAG_INHERIT \
(UMA_ZFLAG_INTERNAL | UMA_ZFLAG_CACHEONLY | UMA_ZFLAG_BUCKET)
+#define PRINT_UMA_ZFLAGS "\20" \
+ "\40CACHEONLY" \
+ "\37TRASH" \
+ "\36INTERNAL" \
+ "\35BUCKET" \
+ "\34RECLAIMING" \
+ "\33CACHE" \
+ "\22MINBUCKET" \
+ "\21NUMA" \
+ "\20PCPU" \
+ "\17NODUMP" \
+ "\16VTOSLAB" \
+ "\15CACHESPREAD" \
+ "\14MAXBUCKET" \
+ "\13NOBUCKET" \
+ "\12SECONDARY" \
+ "\11HASH" \
+ "\10VM" \
+ "\7MTXCLASS" \
+ "\6NOFREE" \
+ "\5MALLOC" \
+ "\4OFFPAGE" \
+ "\3STATIC" \
+ "\2ZINIT" \
+ "\1PAGEABLE"
+
#undef UMA_ALIGN
#ifdef _KERNEL
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 1:53 AM (12 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27870369
Default Alt Text
D22748.id65486.diff (2 KB)
Attached To
Mode
D22748: uma: pretty print zone flags sysctl
Attached
Detach File
Event Timeline
Log In to Comment