Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Change a KASSERT to KASSERTMSG and print enough det...



details:   https://anonhg.NetBSD.org/src/rev/cbeeb4e86436
branches:  trunk
changeset: 334851:cbeeb4e86436
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Dec 10 17:09:49 2014 +0000

description:
Change a KASSERT to KASSERTMSG and print enough details about the callout
so it can be identified even if ddb should not be helpfull (or not enabled).

diffstat:

 sys/kern/kern_timeout.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 7c08e6f948c9 -r cbeeb4e86436 sys/kern/kern_timeout.c
--- a/sys/kern/kern_timeout.c   Wed Dec 10 16:55:54 2014 +0000
+++ b/sys/kern/kern_timeout.c   Wed Dec 10 17:09:49 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_timeout.c,v 1.47 2013/09/14 20:53:48 martin Exp $ */
+/*     $NetBSD: kern_timeout.c,v 1.48 2014/12/10 17:09:49 martin Exp $ */
 
 /*-
  * Copyright (c) 2003, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.47 2013/09/14 20:53:48 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.48 2014/12/10 17:09:49 martin Exp $");
 
 /*
  * Timeouts are kept in a hierarchical timing wheel.  The c_time is the
@@ -309,7 +309,9 @@
         * of c->c_flags.  If the callout could potentially have been
         * running, the current thread should have stopped it.
         */
-       KASSERT((c->c_flags & CALLOUT_PENDING) == 0);
+       KASSERTMSG((c->c_flags & CALLOUT_PENDING) == 0,
+           "callout %p: c_func (%p) c_flags (%#x) destroyed from %p",
+           c, c->c_func, c->c_flags, __builtin_return_address(0));
        KASSERT(c->c_cpu->cc_lwp == curlwp || c->c_cpu->cc_active != c);
        KASSERTMSG(c->c_magic == CALLOUT_MAGIC,
            "callout %p: c_magic (%#x) != CALLOUT_MAGIC (%#x)",



Home | Main Index | Thread Index | Old Index