ZTS: reimplement kstat helper function
commit722cf7bfd5ed9675758c076b961b5ea85a7f0dcf
authorRob Norris <rob.norris@klarasystems.com>
Thu, 16 Jan 2025 00:19:09 +0000 (16 11:19 +1100)
committerTony Hutter <hutter2@llnl.gov>
Tue, 21 Jan 2025 18:12:07 +0000 (21 10:12 -0800)
tree503838746d61568401070271c7d25a63064054a8
parentb8c0c154ad986f147ada9b49307e4dc6f0782b52
ZTS: reimplement kstat helper function

The old kstat helper function was barely used, I suspect in part because
it was very limited in the kinds of kstats it could gather.

This adds new functions to replace it, for each kind of thing that can
have stats: global, pool and dataset. There's options in there to get a
single stat value, or all values within a group.

Most importantly, the interface is the same for both platforms.

Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
tests/zfs-tests/Makefile.am
tests/zfs-tests/include/kstat.shlib [new file with mode: 0644]
tests/zfs-tests/include/libtest.shlib