diff options
author | Rob Norris <[email protected]> | 2024-05-10 13:58:26 +1000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2024-05-14 09:49:00 -0700 |
commit | 3c941d18183455138f7c5dcc212177bd3cea8afc (patch) | |
tree | c53a01b7b96915f25a4bb3b0c53a620bffd9c70f /cmd | |
parent | fa99d9cd9cbc6aca3245afcfe321b8226985597d (diff) |
zdb/ztest: send dbgmsg output to stderr
And, make the output fd an arg to zfs_dbgmsg_print(). This is a change
in behaviour, but keeps it consistent with where crash traces go, and
it's easy to argue this is what we want anyway; this is information
about the task, not the actual output of the task.
Sponsored-by: Klara, Inc.
Sponsored-by: Wasabi Technology, Inc.
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes #16181
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zdb/zdb.c | 4 | ||||
-rw-r--r-- | cmd/ztest.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 7c2819d3c..704fcf442 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -837,8 +837,8 @@ dump_debug_buffer(void) * We use write() instead of printf() so that this function * is safe to call from a signal handler. */ - ret = write(STDOUT_FILENO, "\n", 1); - zfs_dbgmsg_print("zdb"); + ret = write(STDERR_FILENO, "\n", 1); + zfs_dbgmsg_print(STDERR_FILENO, "zdb"); } static void sig_handler(int signo) diff --git a/cmd/ztest.c b/cmd/ztest.c index b4d63b02d..f77a37c21 100644 --- a/cmd/ztest.c +++ b/cmd/ztest.c @@ -615,8 +615,8 @@ dump_debug_buffer(void) * We use write() instead of printf() so that this function * is safe to call from a signal handler. */ - ret = write(STDOUT_FILENO, "\n", 1); - zfs_dbgmsg_print("ztest"); + ret = write(STDERR_FILENO, "\n", 1); + zfs_dbgmsg_print(STDERR_FILENO, "ztest"); } static void sig_handler(int signo) |