dbuf_stats: show flag pairs for ARC headers

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
This commit is contained in:
Rob Norris 2024-02-29 15:34:52 +11:00 committed by Rob Norris
parent 40c83b7b3a
commit 152a731e32
1 changed files with 7 additions and 3 deletions

View File

@ -22,6 +22,7 @@
#include <sys/zfs_context.h> #include <sys/zfs_context.h>
#include <sys/dbuf.h> #include <sys/dbuf.h>
#include <sys/dmu_objset.h> #include <sys/dmu_objset.h>
#include <zfs_pretty.h>
/* /*
* Calculate the index of the arc header for the state, disabled by default. * 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, (void) snprintf(buf, size,
"%-105s | %-119s | %s\n" "%-105s | %-119s | %s\n"
"%-16s %-8s %-8s %-8s %-8s %-10s %-8s %-8s %-5s %-5s %-7s %3s | " "%-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 %-6s %-6s %-6s %-8s %-8s %-8s %-6s | "
"%-6s %-6s %-8s %-8s %-6s %-6s %-6s %-8s %-8s\n", "%-6s %-6s %-8s %-8s %-6s %-6s %-6s %-8s %-8s\n",
"dbuf", "arcbuf", "dnode", "pool", "objset", "object", "level", "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); __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, nwritten = snprintf(buf, size,
"%-16s %-8llu %-8lld %-8lld %-8lld %-10llu %-8llu %-8llu " "%-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 | " "%-6lu %-6lu %-6lu %-6lu %-6lu %-8llu %-8llu %-8d %-6lu | "
"%-6d %-6d %-8lu %-8lu %-6llu %-6lu %-6lu %-8llu %-8llu\n", "%-6d %-6d %-8lu %-8lu %-6llu %-6lu %-6lu %-8llu %-8llu\n",
/* dmu_buf_impl_t */ /* 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 */ /* arc_buf_info_t */
abi.abi_state_type, abi.abi_state_type,
abi.abi_state_contents, abi.abi_state_contents,
abi.abi_flags, flagstr,
(ulong_t)abi.abi_bufcnt, (ulong_t)abi.abi_bufcnt,
(u_longlong_t)abi.abi_size, (u_longlong_t)abi.abi_size,
(u_longlong_t)abi.abi_access, (u_longlong_t)abi.abi_access,