linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix BUG macro
@ 2002-05-16  8:08 Rusty Russell
  2002-05-16 11:21 ` Hugh Dickins
  2002-05-16 16:27 ` Ghozlane Toumi
  0 siblings, 2 replies; 22+ messages in thread
From: Rusty Russell @ 2002-05-16  8:08 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

Replaces filename with object name.  Sure, it's not as canonical, but
it means that ccache works across different directories (at the
moment, ccache gets almost no caceh hits when you compile in a
different dir).

Thanks to Stephen Rothwell for the inspiration,
Rusty.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.15/include/asm-i386/page.h working-2.5.15-rcu/include/asm-i386/page.h
--- linux-2.5.15/include/asm-i386/page.h	Wed May 15 19:53:25 2002
+++ working-2.5.15-rcu/include/asm-i386/page.h	Thu May 16 17:34:47 2002
@@ -96,11 +96,16 @@
  */
 
 #if 1	/* Set to zero for a slightly smaller kernel */
+#define __STRINGIZE2(x) #x
+#define __STRINGIZE(x) __STRINGIZE2(x)
 #define BUG()				\
  __asm__ __volatile__(	"ud2\n"		\
 			"\t.word %c0\n"	\
 			"\t.long %c1\n"	\
-			 : : "i" (__LINE__), "i" (__FILE__))
+			"\t.long %c2\n"	\
+			 : : "i" (__LINE__), \
+			"i" (__STRINGIZE(KBUILD_BASENAME)), \
+			"i" (__FUNCTION__))
 #else
 #define BUG() __asm__ __volatile__("ud2\n")
 #endif
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.15/arch/i386/kernel/traps.c working-2.5.15-rcu/arch/i386/kernel/traps.c
--- linux-2.5.15/arch/i386/kernel/traps.c	Tue Apr 23 11:39:32 2002
+++ working-2.5.15-rcu/arch/i386/kernel/traps.c	Thu May 16 17:43:28 2002
@@ -245,7 +245,7 @@
 {
 	unsigned short ud2;
 	unsigned short line;
-	char *file;
+	char *object, *func;
 	char c;
 	unsigned long eip;
 
@@ -262,11 +262,14 @@
 		goto no_bug;
 	if (__get_user(line, (unsigned short *)(eip + 2)))
 		goto bug;
-	if (__get_user(file, (char **)(eip + 4)) ||
-		(unsigned long)file < PAGE_OFFSET || __get_user(c, file))
-		file = "<bad filename>";
+	if (__get_user(object, (char **)(eip + 4)) ||
+		(unsigned long)object < PAGE_OFFSET || __get_user(c, object))
+		object = "<bad objectname>";
+	if (__get_user(func, (char **)(eip + 8)) ||
+		(unsigned long)func < PAGE_OFFSET || __get_user(c, func))
+		func = "<bad funcname>";
 
-	printk("kernel BUG at %s:%d!\n", file, line);
+	printk("kernel BUG at %s:%s:%d!\n", object, func, line);
 
 no_bug:
 	return;

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2002-05-18  6:28 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-16  8:08 [PATCH] Fix BUG macro Rusty Russell
2002-05-16 11:21 ` Hugh Dickins
2002-05-17  0:31   ` Rusty Russell
2002-05-17  7:56     ` Hugh Dickins
2002-05-17  9:43       ` Rusty Russell
2002-05-17 11:47         ` Hugh Dickins
2002-05-17 12:02           ` Andreas Schwab
2002-05-17 12:46           ` Rusty Russell
2002-05-17 13:19             ` Hugh Dickins
2002-05-16 16:27 ` Ghozlane Toumi
2002-05-17  2:25   ` Rusty Russell
2002-05-17  2:41     ` Andrew Morton
2002-05-17  4:25       ` Rusty Russell
2002-05-17  4:50         ` Andrew Morton
2002-05-17  5:20           ` Rusty Russell
2002-05-17  6:44             ` Andrew Morton
2002-05-17  9:39               ` Rusty Russell
2002-05-17 16:14                 ` Kai Germaschewski
2002-05-17 18:41                   ` Andrew Morton
2002-05-17 22:35                     ` Stevie O
2002-05-17 23:09                       ` Kai Germaschewski
2002-05-18  6:28                     ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).