Module Name: src Committed By: andvar Date: Sun Jan 14 11:46:05 UTC 2024
Modified Files: src/sys/kern: kern_lock.c Log Message: Surround db_stacktrace() with "#ifdef DDB" check. Fixes LOCKDEBUG enabled build without DDB option. To generate a diff of this commit: cvs rdiff -u -r1.187 -r1.188 src/sys/kern/kern_lock.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/kern_lock.c diff -u src/sys/kern/kern_lock.c:1.187 src/sys/kern/kern_lock.c:1.188 --- src/sys/kern/kern_lock.c:1.187 Wed Oct 4 20:28:06 2023 +++ src/sys/kern/kern_lock.c Sun Jan 14 11:46:05 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_lock.c,v 1.187 2023/10/04 20:28:06 ad Exp $ */ +/* $NetBSD: kern_lock.c,v 1.188 2024/01/14 11:46:05 andvar Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2020, 2023 @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.187 2023/10/04 20:28:06 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_lock.c,v 1.188 2024/01/14 11:46:05 andvar Exp $"); #ifdef _KERNEL_OPT #include "opt_lockdebug.h" @@ -137,7 +137,9 @@ lockops_t _kernel_lock_ops = { #ifdef LOCKDEBUG +#ifdef DDB #include <ddb/ddb.h> +#endif static void kernel_lock_trace_ipi(void *cookie) @@ -146,7 +148,9 @@ kernel_lock_trace_ipi(void *cookie) printf("%s[%d %s]: hogging kernel lock\n", cpu_name(curcpu()), curlwp->l_lid, curlwp->l_name ? curlwp->l_name : curproc->p_comm); +#ifdef DDB db_stacktrace(); +#endif } #endif