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 <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@klarasystems.com>
Closes #16181
This commit is contained in:
Rob Norris
2024-05-10 13:58:26 +10:00
committed by Tony Hutter
parent 63f70d3c61
commit 16266b47a1
5 changed files with 26 additions and 28 deletions
+2 -2
View File
@@ -938,8 +938,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");
}
#define BACKTRACE_SZ 100
+2 -2
View File
@@ -593,8 +593,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");
}
#define BACKTRACE_SZ 100