Skip to content

Commit

Permalink
Simplify diagnostic kstat for pool status
Browse files Browse the repository at this point in the history
This commit updates the kstat for pool status and simplifies by
creating an nvlist that contains the pool status. This nvlist is then
printed to provided buffer in JSON format. The redundant parts of code
have also been removed.

Signed-off-by: Umer Saleem <[email protected]>
  • Loading branch information
usaleem-ix committed Oct 24, 2024
1 parent 2ad5b24 commit 640c353
Show file tree
Hide file tree
Showing 10 changed files with 819 additions and 1,043 deletions.
1 change: 0 additions & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ COMMON_H = \


KERNEL_H = \
sys/jprint.h \
sys/spa_json_stats.h \
sys/zfs_ioctl.h \
sys/zfs_ioctl_impl.h \
Expand Down
70 changes: 0 additions & 70 deletions include/sys/jprint.h

This file was deleted.

2 changes: 2 additions & 0 deletions include/sys/nvpair.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ _SYS_NVPAIR_H int nvlist_remove(nvlist_t *, const char *, data_type_t);
_SYS_NVPAIR_H int nvlist_remove_all(nvlist_t *, const char *);
_SYS_NVPAIR_H int nvlist_remove_nvpair(nvlist_t *, nvpair_t *);

_SYS_NVPAIR_H int nvlist_to_json(nvlist_t *, char **, size_t);

_SYS_NVPAIR_H int nvlist_lookup_boolean(const nvlist_t *, const char *);
_SYS_NVPAIR_H int nvlist_lookup_boolean_value(const nvlist_t *, const char *,
boolean_t *);
Expand Down
7 changes: 7 additions & 0 deletions lib/libnvpair/libnvpair.abi
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
<elf-symbol name='nvlist_empty' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='nvlist_exists' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='nvlist_free' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='nvlist_to_json' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='nvlist_lookup_boolean' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='nvlist_lookup_boolean_array' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
<elf-symbol name='nvlist_lookup_boolean_value' type='func-type' binding='global-binding' visibility='default-visibility' is-defined='yes'/>
Expand Down Expand Up @@ -2951,6 +2952,12 @@
<parameter type-id='3fa542f0' name='nvp'/>
<return type-id='95e97e5e'/>
</function-decl>
<function-decl name='nvlist_to_json' mangled-name='nvlist_to_json' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='nvlist_to_json'>
<parameter type-id='5ce45b60' name='nvl'/>
<parameter type-id='9b23c9ad' name='buf'/>
<parameter type-id='b59d7dce' name='size'/>
<return type-id='95e97e5e'/>
</function-decl>
<function-decl name='nvlist_add_boolean' mangled-name='nvlist_add_boolean' visibility='default' binding='global' size-in-bits='64' elf-symbol-id='nvlist_add_boolean'>
<parameter type-id='5ce45b60' name='nvl'/>
<parameter type-id='80f4b756' name='name'/>
Expand Down
1 change: 0 additions & 1 deletion lib/libzpool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ nodist_libzpool_la_SOURCES = \
module/zfs/fm.c \
module/zfs/gzip.c \
module/zfs/hkdf.c \
module/zfs/jprint.c \
module/zfs/lz4.c \
module/zfs/lz4_zfs.c \
module/zfs/lzjb.c \
Expand Down
1 change: 0 additions & 1 deletion module/Kbuild.in
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@ ZFS_OBJS := \
fm.o \
gzip.o \
hkdf.o \
jprint.o \
lz4.o \
lz4_zfs.o \
lzjb.o \
Expand Down
1 change: 0 additions & 1 deletion module/Makefile.bsd
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ SRCS+= abd.c \
edonr_zfs.c \
fm.c \
gzip.c \
jprint.c \
lz4.c \
lz4_zfs.c \
lzjb.c \
Expand Down
Loading

0 comments on commit 640c353

Please sign in to comment.