rpms/kernel/FC-6 linux-2.6-debug-verbosify-bug.patch, NONE, 1.1 kernel-2.6.spec, 1.2827, 1.2828

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Oct 30 05:13:41 UTC 2006


Author: davej

Update of /cvs/dist/rpms/kernel/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv21096

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-debug-verbosify-bug.patch 
Log Message:
Include more verbose BUG() data

linux-2.6-debug-verbosify-bug.patch:
 bug.h |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

--- NEW FILE linux-2.6-debug-verbosify-bug.patch ---
>From davej  Fri Oct 20 12:55:15 2006
Return-path: <linux-kernel-owner+davej=40kernelslacker.org-S2992677AbWJTQyR at vger.kernel.org>
X-Spam-Checker-Version: SpamAssassin 3.1.4 (2006-07-25) on 
	pressure.kernelslacker.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=3.1.4
Envelope-to: davej at kernelslacker.org
Delivery-date: Fri, 20 Oct 2006 17:55:08 +0100
Received: from testure.choralone.org [194.9.77.134]
	by pressure.kernelslacker.org with IMAP (fetchmail-6.3.4)
	for <davej at localhost> (single-drop); Fri, 20 Oct 2006 12:55:15 -0400 (EDT)
Received: from vger.kernel.org ([209.132.176.167])
	by testure.choralone.org with esmtp (Exim 4.63)
	(envelope-from <linux-kernel-owner+davej=40kernelslacker.org-S2992677AbWJTQyR at vger.kernel.org>)
	id 1GaxeG-0007Se-Do
	for davej at kernelslacker.org; Fri, 20 Oct 2006 17:55:08 +0100
Received: (majordomo at vger.kernel.org) by vger.kernel.org via listexpand
	id S2992677AbWJTQyR (ORCPT <rfc822;davej at kernelslacker.org>);
	Fri, 20 Oct 2006 12:54:17 -0400
Received: (majordomo at vger.kernel.org) by vger.kernel.org id S2992676AbWJTQyR
	(ORCPT <rfc822;linux-kernel-outgoing>);
	Fri, 20 Oct 2006 12:54:17 -0400
Received: from mx1.redhat.com ([66.187.233.31]:37506 "EHLO mx1.redhat.com")
	by vger.kernel.org with ESMTP id S2992677AbWJTQyP (ORCPT
	<rfc822;linux-kernel at vger.kernel.org>);
	Fri, 20 Oct 2006 12:54:15 -0400
Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254])
	by mx1.redhat.com (8.12.11.20060308/8.12.11) with ESMTP id k9KGsEA7015181
	for <linux-kernel at vger.kernel.org>; Fri, 20 Oct 2006 12:54:14 -0400
Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15])
	by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id k9KGsEKt005767
	for <linux-kernel at vger.kernel.org>; Fri, 20 Oct 2006 12:54:14 -0400
Received: from [10.15.80.10] (neon.msp.redhat.com [10.15.80.10])
	by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id k9KGsC3X017560
	for <linux-kernel at vger.kernel.org>; Fri, 20 Oct 2006 12:54:13 -0400
Message-ID: <4538FF32.8050604 at sandeen.net>
Date:	Fri, 20 Oct 2006 11:54:10 -0500
From:	Eric Sandeen <sandeen at sandeen.net>
User-Agent: Thunderbird 1.5.0.7 (X11/20060913)
MIME-Version: 1.0
To:	Linux Kernel Mailing List <linux-kernel at vger.kernel.org>
Subject: Re: [PATCH] (update) more helpful WARN_ON and BUG_ON messages
References: <4538F81A.2070007 at redhat.com>
In-Reply-To: <4538F81A.2070007 at redhat.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Sender:	linux-kernel-owner at vger.kernel.org
Precedence: bulk
X-Mailing-List:	linux-kernel at vger.kernel.org
Status: RO
Content-Length: 1897
Lines: 66

After a few bugs I encountered in FC6 in buffer.c, with output like:

Kernel BUG at fs/buffer.c: 2791

where buffer.c contains:

...
        BUG_ON(!buffer_locked(bh));
        BUG_ON(!buffer_mapped(bh));
        BUG_ON(!bh->b_end_io);
...

around line 2790, it's awfully tedious to go get the exact failing kernel tree
just to see -which- BUG_ON was encountered.

Printing out the failing condition as a string would make this more helpful IMHO.

--- linux-2.6.18.noarch/include/asm-generic/bug.h~	2006-10-30 00:09:01.000000000 -0500
+++ linux-2.6.18.noarch/include/asm-generic/bug.h	2006-10-30 00:11:12.000000000 -0500
@@ -34,11 +34,22 @@ extern const char *print_tainted(void);
 #endif
 
 #ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (condition) ; } while(0)
+#define BUG_ON(condition) do { \
+	if (unlikely((condition)!=0)) { \
+		printk("BUGging on (%s)\n", #condition); \
+		BUG(); \
+	} \
+} while(0)
 #endif
 
 #ifndef HAVE_ARCH_WARN_ON
-#define WARN_ON(condition) do { if (condition) ; } while(0)
+#define WARN_ON(condition) do { \
+	if (unlikely((condition)!=0)) { \
+		printk("BUG: warning: (%s) at %s:%d/%s()\n", \
+			#condition, __FILE__, __LINE__, __FUNCTION__); \
+		dump_stack(); \
+	} \
+} while (0)
 #endif
 #endif
 
@@ -49,7 +60,7 @@ extern const char *print_tainted(void);
 							\
 	if (unlikely((condition) && __warn_once)) {	\
 		__warn_once = 0;			\
-		WARN_ON(1);				\
+		WARN_ON(condition);				\
 		__ret = 1;				\
 	}						\
 	__ret;						\


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/FC-6/kernel-2.6.spec,v
retrieving revision 1.2827
retrieving revision 1.2828
diff -u -r1.2827 -r1.2828
--- kernel-2.6.spec	30 Oct 2006 04:59:20 -0000	1.2827
+++ kernel-2.6.spec	30 Oct 2006 05:13:37 -0000	1.2828
@@ -396,6 +396,7 @@
 Patch1021: linux-2.6-debug-boot-delay.patch
 Patch1022: linux-2.6-debug-sysfs-crash-debugging.patch
 Patch1023: linux-2.6-debug-sysfs-crash-debugging-xen.patch
+Patch1024: linux-2.6-debug-verbosify-bug.patch
 
 # Restrict /dev/mem usage.
 Patch1050: linux-2.6-devmem.patch
@@ -992,6 +993,7 @@
 %if %{includexen}
 %patch1023 -p1
 %endif
+%patch1024 -p1
 
 #
 # Make /dev/mem a need-to-know function
@@ -2074,6 +2076,7 @@
 %changelog
 * Sun Oct 29 2006 Dave Jones <davej at redhat.com>
 - More ext3 robustness fixes.
+- Include more verbose BUG() data
 
 * Sat Oct 28 2006 David Woodhouse <dwmw2 at redhat.com>
 - Update battery and café NAND support




More information about the fedora-cvs-commits mailing list