Skip to content

Commit

Permalink
Illumos 5134 - if ZFS_DEBUG or debug= is set, libzpool should enable …
Browse files Browse the repository at this point in the history
…debug prints

5134 if ZFS_DEBUG or debug= is set, libzpool should enable debug prints
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Christopher Siden <[email protected]>
Reviewed by: George Wilson <[email protected]>
Reviewed by: Saso Kiselkov <[email protected]>
Approved by: Dan McDonald <[email protected]>

References:
  https://www.illumos.org/projects/illumos-gate/issues/5134
  illumos/illumos-gate@7fa49ea

Porting notes:
  Added dprintf_setup() to main in zfs_main.c and zpool_main.c.

Ported by: Turbo Fredriksson <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #2669
  • Loading branch information
ahrens authored and behlendorf committed Apr 28, 2015
1 parent ecfb0b5 commit 308a451
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/zfs/zfs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -6661,6 +6661,8 @@ main(int argc, char **argv)
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);

dprintf_setup(&argc, argv);

opterr = 0;

/*
Expand Down
2 changes: 2 additions & 0 deletions cmd/zpool/zpool_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5879,6 +5879,8 @@ main(int argc, char **argv)
(void) setlocale(LC_ALL, "");
(void) textdomain(TEXT_DOMAIN);

dprintf_setup(&argc, argv);

opterr = 0;

/*
Expand Down
3 changes: 3 additions & 0 deletions lib/libzpool/kernel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/*
Expand Down

0 comments on commit 308a451

Please sign in to comment.