From 152a731e3207cfd4d7bb8906e41635bb24bdba62 Mon Sep 17 00:00:00 2001 From: Rob Norris Date: Thu, 29 Feb 2024 15:34:52 +1100 Subject: [PATCH] dbuf_stats: show flag pairs for ARC headers Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. --- module/zfs/dbuf_stats.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/module/zfs/dbuf_stats.c b/module/zfs/dbuf_stats.c index ccee8997e10e..f1c94b0bfb40 100644 --- a/module/zfs/dbuf_stats.c +++ b/module/zfs/dbuf_stats.c @@ -22,6 +22,7 @@ #include #include #include +#include /* * Calculate the index of the arc header for the state, disabled by default. @@ -48,7 +49,7 @@ dbuf_stats_hash_table_headers(char *buf, size_t size) (void) snprintf(buf, size, "%-105s | %-119s | %s\n" "%-16s %-8s %-8s %-8s %-8s %-10s %-8s %-8s %-5s %-5s %-7s %3s | " - "%-5s %-5s %-9s %-6s %-8s %-12s " + "%-5s %-5s %-20s %-6s %-8s %-12s " "%-6s %-6s %-6s %-6s %-6s %-8s %-8s %-8s %-6s | " "%-6s %-6s %-8s %-8s %-6s %-6s %-6s %-8s %-8s\n", "dbuf", "arcbuf", "dnode", "pool", "objset", "object", "level", @@ -74,9 +75,12 @@ __dbuf_stats_hash_table_data(char *buf, size_t size, dmu_buf_impl_t *db) __dmu_object_info_from_dnode(dn, &doi); + char flagstr[128]; + zfs_pretty_arc_flag_pairs(abi.abi_flags, flagstr, sizeof (flagstr)); + nwritten = snprintf(buf, size, "%-16s %-8llu %-8lld %-8lld %-8lld %-10llu %-8llu %-8llu " - "%-5d %-5d %-7lu %-3d | %-5d %-5d 0x%-7x %-6lu %-8llu %-12llu " + "%-5d %-5d %-7lu %-3d | %-5d %-5d %-20s %-6lu %-8llu %-12llu " "%-6lu %-6lu %-6lu %-6lu %-6lu %-8llu %-8llu %-8d %-6lu | " "%-6d %-6d %-8lu %-8lu %-6llu %-6lu %-6lu %-8llu %-8llu\n", /* dmu_buf_impl_t */ @@ -95,7 +99,7 @@ __dbuf_stats_hash_table_data(char *buf, size_t size, dmu_buf_impl_t *db) /* arc_buf_info_t */ abi.abi_state_type, abi.abi_state_contents, - abi.abi_flags, + flagstr, (ulong_t)abi.abi_bufcnt, (u_longlong_t)abi.abi_size, (u_longlong_t)abi.abi_access,