zdb: add --bin=(lsize|psize|asize) arg to control histogram binning

When counting blocks to generate block size histograms (`-bb`), accept a
`--bin=` argument to force placing blocks into all three bins based on
*this* size.

E.g. with `--bin=lsize`, a block with lsize=512K, psize=128K, asize=256K
will be placed into the "512K" bin in all three output columns. This
way, by looking at the "512K" row the user will be able to determine
how well was ZFS able to compress blocks of this logical size.

Conversely, with `--bin=psize`, by looking at the "128K" row the user
will be able to determine how much overhead was incurred for storage
of blocks of this physical size.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Closes #16999
This commit is contained in:
Ivan Shapovalov
2024-12-10 04:44:19 +04:00
committed by Brian Behlendorf
parent 1269fa9b79
commit 8e97b98140
2 changed files with 67 additions and 3 deletions
+10
View File
@@ -144,6 +144,16 @@ subcommand.
Display statistics regarding the number, size
.Pq logical, physical and allocated
and deduplication of blocks.
.It Fl -bin Ns = Ns ( Li lsize Ns | Ns Li psize Ns | Ns Li asize )
When used with
.Fl bb ,
sort blocks into all three bins according to the given size (instead of binning
a block for each size separately).
.Pp
For instance, with
.Fl -bin Ns = Ns Li lsize ,
a block with lsize of 16K and psize of 4K will be added to the 16K bin
in all three columns.
.It Fl B , -backup
Generate a backup stream, similar to
.Nm zfs Cm send ,