diff --git a/sys/dev/xen/debug/debug.c b/sys/dev/xen/debug/debug.c --- a/sys/dev/xen/debug/debug.c +++ b/sys/dev/xen/debug/debug.c @@ -58,8 +58,11 @@ static int xendebug_drain(void *arg, const char *str, int len) { - - HYPERVISOR_console_write(__DECONST(char *, str), len); + /* + * Use xen_emergency_print() instead of xc_printf() to avoid the + * overhead of parsing a format string when it's not needed. + */ + xen_emergency_print(str, len); return (len); } @@ -75,10 +78,9 @@ stack_save(&st); mtx_lock_spin(&lock); - sbuf_clear(buf); xc_printf("Printing stack trace vCPU%u\n", XEN_VCPUID()); stack_sbuf_print_ddb(buf, &st); - sbuf_finish(buf); + sbuf_drain(buf); mtx_unlock_spin(&lock); #endif