xref: /freebsd/sys/contrib/openzfs/man/man1/dbufstat.1 (revision d8fbbd371ca11d9ad4b29b9d3a316885a5da0b15)
1.\" SPDX-License-Identifier: CDDL-1.0
2.\"
3.\" This file and its contents are supplied under the terms of the
4.\" Common Development and Distribution License ("CDDL"), version 1.0.
5.\" You may only use this file in accordance with the terms of version
6.\" 1.0 of the CDDL.
7.\"
8.\" A full copy of the text of the CDDL should have accompanied this
9.\" source.  A copy of the CDDL is also available via the Internet at
10.\" http://www.illumos.org/license/CDDL.
11.\"
12.\" Copyright (C) 2013 Lawrence Livermore National Security, LLC.
13.\"
14.Dd March 19, 2026
15.Dt DBUFSTAT 1
16.Os
17.
18.Sh NAME
19.Nm dbufstat
20.Nd display statistics for DMU buffer cache
21.Sh SYNOPSIS
22.Nm
23.Op Fl bdhnrtvx
24.Op Fl f Ar field Ns Op , Ns Ar field Ns …
25.Op Fl F Ar field Ns = Ns Ar value Ns Op , Ns …
26.Op Fl i Ar file
27.Op Fl o Ar file
28.Op Fl s Ar separator
29.
30.Sh DESCRIPTION
31.Nm
32displays statistics about the DMU (Data Management Unit) buffer
33cache, also known as the dbuf cache.
34This information is read from the
35.Sy dbufs
36kstat
37.Po Pa /proc/spl/kstat/zfs/dbufs
38on Linux and
39.Sy kstat.zfs.misc.dbufs
40on FreeBSD
41.Pc .
42.Pp
43.Nm
44can display data in three modes:
45.Bl -tag -width "-b"
46.It Fl b
47Display a table of information for each individual dbuf
48(buffer).
49This is the most detailed view.
50.It Fl d
51Display a table of information for each dnode
52(the default mode).
53Multiple dbufs belonging to the same dnode are
54aggregated.
55.It Fl t
56Display a table of information for each dnode type.
57Multiple dnodes of the same type are aggregated.
58.El
59.Pp
60The following fields are available for display.
61Not all fields are compatible with all modes; use
62.Fl v
63to see which fields are incompatible with each mode.
64.Bl -tag -compact -offset Ds -width "indirect"
65.It Sy pool
66Pool name.
67.It Sy objset
68Dataset identification number.
69.It Sy object
70Object number.
71.It Sy level
72Indirection level of buffer.
73.It Sy blkid
74Block number of buffer.
75.It Sy offset
76Offset in object of buffer.
77.It Sy dbsize
78Size of buffer.
79.It Sy usize
80Size of attached user data.
81.It Sy meta
82Whether this buffer is metadata.
83.It Sy state
84State of buffer (read, cached, etc).
85.It Sy dbholds
86Number of holds on buffer.
87.It Sy dbc
88Whether this buffer is in the dbuf cache.
89.It Sy list
90Which ARC list contains this buffer.
91.It Sy atype
92ARC header type (data or metadata).
93.It Sy flags
94ARC read flags.
95.It Sy count
96ARC data count.
97.It Sy asize
98Size of this ARC buffer.
99.It Sy access
100Time this ARC buffer was last accessed.
101.It Sy mru
102Hits while on the ARC's MRU list.
103.It Sy gmru
104Hits while on the ARC's MRU ghost list.
105.It Sy mfu
106Hits while on the ARC's MFU list.
107.It Sy gmfu
108Hits while on the ARC's MFU ghost list.
109.It Sy l2
110Hits while on the L2ARC.
111.It Sy l2_dattr
112L2ARC disk address/offset.
113.It Sy l2_asize
114L2ARC allocated size (depends on compression).
115.It Sy l2_comp
116L2ARC compression algorithm for buffer.
117.It Sy aholds
118Number of holds on this ARC buffer.
119.It Sy dtype
120Dnode type.
121.It Sy btype
122Bonus buffer type.
123.It Sy data_bs
124Data block size.
125.It Sy meta_bs
126Metadata block size.
127.It Sy bsize
128Bonus buffer size.
129.It Sy lvls
130Number of indirection levels.
131.It Sy dholds
132Number of holds on dnode.
133.It Sy blocks
134Number of allocated blocks.
135.It Sy dsize
136Size of dnode.
137.It Sy cached
138Bytes cached for all blocks.
139.It Sy direct
140Bytes cached for direct blocks.
141.It Sy indirect
142Bytes cached for indirect blocks.
143.It Sy bonus
144Bytes cached for bonus buffer.
145.It Sy spill
146Bytes cached for spill block.
147.El
148.
149.Sh OPTIONS
150.Bl -tag -width "-F filter"
151.It Fl b
152Display information for each individual dbuf.
153.It Fl d
154Display information for each dnode (default).
155.It Fl f Ar field Ns Op , Ns Ar field Ns …
156Display only the specified fields.
157.It Fl F Ar field Ns = Ns Ar value Ns Op , Ns …
158Filter output by field value or regular expression.
159Multiple filters may be specified as a comma-separated list.
160.It Fl h
161Display a help message.
162.It Fl i Ar file
163Redirect input from the specified file instead of the
164.Sy dbufs
165kstat.
166.It Fl n
167Exclude the header from output.
168.It Fl o Ar file
169Redirect output to the specified file instead of standard output.
170.It Fl r
171Display raw values.
172Specify twice to also display numeric type and compression
173identifiers instead of names.
174.It Fl s Ar separator
175Override the default field separator (two spaces) with a
176custom character or string.
177.It Fl t
178Display information for each dnode type.
179.It Fl v
180List all possible field headers, definitions, and
181incompatibilities for each mode.
182.It Fl x
183Display extended statistics.
184.El
185.
186.Sh EXAMPLES
187Display per-dnode statistics (default mode):
188.Bd -literal -compact -offset Ds
189# dbufstat -d
190       pool  objset  object                      dtype  cached
191      zroot      30   34466  DMU_OT_DIRECTORY_CONTENTS    240K
192      zroot      30       0               DMU_OT_DNODE     14M
193      zroot      30   36343  DMU_OT_DIRECTORY_CONTENTS    1024
194      zroot      30   32921 DMU_OT_PLAIN_FILE_CONTENTS    2.5K
195.Ed
196.Pp
197Display per-type statistics:
198.Bd -literal -compact -offset Ds
199# dbufstat -t
200       pool  objset                      dtype  cached
201      zroot      30  DMU_OT_DIRECTORY_CONTENTS    1.9M
202      zroot      30               DMU_OT_DNODE     14M
203      zroot      30 DMU_OT_PLAIN_FILE_CONTENTS    8.4M
204      zroot       0           DMU_OT_DSL_PROPS    2.6M
205.Ed
206.Pp
207Display per-buffer statistics:
208.Bd -literal -compact -offset Ds
209# dbufstat -b
210       pool  objset  object  level  blkid  offset  dbsize
211      zroot      30   34466      1      0       0    128K
212      zroot      30       0      0    292    4.6M     16K
213      zroot      30   34466      0      8    128K     16K
214      zroot       0       4      0      0       0    128K
215.Ed
216.Pp
217Display specific fields per dnode:
218.Dl # Nm dbufstat Fl d Fl f Ar pool,object,objset,dsize,cached
219.Pp
220Display per-type statistics with comma-separated output:
221.Dl # Nm dbufstat Fl t Fl s Qq ,
222.Pp
223Display extended per-buffer statistics with filters:
224.Dl # Nm dbufstat Fl bx Fl F Ar dbc=1,pool=zroot
225.
226.Sh SEE ALSO
227.Xr zarcstat 1 ,
228.Xr zfs 8 ,
229.Xr zpool-iostat 8
230.
231.Sh AUTHORS
232This man page was written by
233.An Christos Longros Aq Mt chris.longros@gmail.com .
234