nvlist: Add nvlist_snprintf() and zfs_dbgmsg_nvlist()

Add nvlist_snprintf() to print a nvlist to a buffer.  This is basically
the snprintf() version of dump_nvlist().  Along with that, add a
zfs_dbgmsg_nvlist() to print out an nvlist to dbgmsg.  This will aid in
debugging.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #17215
This commit is contained in:
Tony Hutter
2025-04-18 06:22:16 -07:00
committed by GitHub
parent ba03054c83
commit 8d1489735b
12 changed files with 488 additions and 332 deletions
+2
View File
@@ -267,6 +267,8 @@ _SYS_NVPAIR_H int nvlist_lookup_double(const nvlist_t *, const char *,
double *);
#endif
_SYS_NVPAIR_H int nvlist_snprintf(char *, size_t, nvlist_t *, int);
_SYS_NVPAIR_H int nvlist_lookup_nvpair(nvlist_t *, const char *, nvpair_t **);
_SYS_NVPAIR_H int nvlist_lookup_nvpair_embedded_index(nvlist_t *, const char *,
nvpair_t **, int *, const char **);