From 2254cbdadae2de3f78193077faebfd5a5eee9697 Mon Sep 17 00:00:00 2001 From: Matthew Ahrens Date: Sat, 6 Sep 2014 00:03:09 +0200 Subject: [PATCH] 2669: turbo/illumos-5134 - if ZFS_DEBUG or debug= is set, libzpool should enable debug prints Reviewed by: Christopher Siden christopher.siden@delphix.com Reviewed by: Adam Leventhal adam.leventhal@delphix.com References: https://www.illumos.org/projects/illumos-gate/issues/5134 https://github.com/illumos/illumos-gate/commit/7fa49ea Porting notes: Run dprintf_setup() in main. Ported by: Turbo Fredriksson --- cmd/zpool/zpool_main.c | 2 ++ lib/libzpool/kernel.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 2b6ff4a658c6..e53f897e517c 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -5851,6 +5851,8 @@ main(int argc, char **argv) (void) setlocale(LC_ALL, ""); (void) textdomain(TEXT_DOMAIN); + dprintf_setup(&argc, argv); + opterr = 0; /* diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index 995f61d05de2..9b46161c5b32 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -837,6 +837,9 @@ dprintf_setup(int *argc, char **argv) */ if (dprintf_find_string("on")) dprintf_print_all = 1; + + if (dprintf_string != NULL) + zfs_flags |= ZFS_DEBUG_DPRINTF; } /*