Skip to content

Commit

Permalink
dbuf_stats: show flag pairs for ARC headers
Browse files Browse the repository at this point in the history
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
  • Loading branch information
robn committed Jul 26, 2024
1 parent 40c83b7 commit 152a731
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions module/zfs/dbuf_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <sys/zfs_context.h>
#include <sys/dbuf.h>
#include <sys/dmu_objset.h>
#include <zfs_pretty.h>

/*
* Calculate the index of the arc header for the state, disabled by default.
Expand All @@ -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",
Expand All @@ -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 */
Expand All @@ -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,
Expand Down

0 comments on commit 152a731

Please sign in to comment.