Module Name: src Committed By: riastradh Date: Fri Jan 1 14:08:33 UTC 2021
Modified Files: src/sys/kern: subr_lockdebug.c Log Message: Use printf, not printf_nolog, in lockdebug dumps. Otherwise we get no diagnostic information in crash dumps or dmesg, which really puts a damper on the utility of lockdebug. (If there's a reason for printf_nolog instead of printf, it should be documented in comments here, and it had better be a pretty good reason for destroying the diagnostic information that is half the point of lockdebug.) To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/sys/kern/subr_lockdebug.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/subr_lockdebug.c diff -u src/sys/kern/subr_lockdebug.c:1.78 src/sys/kern/subr_lockdebug.c:1.79 --- src/sys/kern/subr_lockdebug.c:1.78 Fri Jan 1 14:04:17 2021 +++ src/sys/kern/subr_lockdebug.c Fri Jan 1 14:08:33 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_lockdebug.c,v 1.78 2021/01/01 14:04:17 riastradh Exp $ */ +/* $NetBSD: subr_lockdebug.c,v 1.79 2021/01/01 14:08:33 riastradh Exp $ */ /*- * Copyright (c) 2006, 2007, 2008, 2020 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.78 2021/01/01 14:04:17 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.79 2021/01/01 14:08:33 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -784,12 +784,12 @@ lockdebug_abort1(const char *func, size_ return; } - printf_nolog("%s error: %s,%zu: %s\n\n", ld->ld_lockops->lo_name, + printf("%s error: %s,%zu: %s\n\n", ld->ld_lockops->lo_name, func, line, msg); - lockdebug_dump(curlwp, ld, printf_nolog); + lockdebug_dump(curlwp, ld, printf); __cpu_simple_unlock(&ld->ld_spinlock); splx(s); - printf_nolog("\n"); + printf("\n"); if (dopanic) panic("LOCKDEBUG: %s error: %s,%zu: %s", ld->ld_lockops->lo_name, func, line, msg); @@ -1039,14 +1039,14 @@ lockdebug_abort(const char *func, size_t if (atomic_inc_uint_nv(&ld_panic) > 1) return; - printf_nolog("%s error: %s,%zu: %s\n\n" + printf("%s error: %s,%zu: %s\n\n" "lock address : %#018lx\n" "current cpu : %18d\n" "current lwp : %#018lx\n", ops->lo_name, func, line, msg, (long)lock, (int)cpu_index(curcpu()), (long)curlwp); - (*ops->lo_dump)(lock, printf_nolog); - printf_nolog("\n"); + (*ops->lo_dump)(lock, printf); + printf("\n"); panic("lock error: %s: %s,%zu: %s: lock %p cpu %d lwp %p", ops->lo_name, func, line, msg, lock, cpu_index(curcpu()), curlwp);