Skip to contentSkip to conversation

2.6.3 sync unwind code with 2.4.25

PATCH In review Keith Owens 2 participants 10 messages Feb 23, 2004 – Feb 24, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.6.3 sync unwind code with 2.4.25

The unwind code in 2.6.3 is missing a debug patch. This patch is in 2.4.25 and makes it much easier to diagnose unwind problems. printk output does not appear when in_interrupt(), kdb_printf output does. This brings 2.6.3 unwind closer to 2.4.25.

Index: 3.1/arch/ia64/kernel/unwind.c

arch/ia64/kernel/unwind.c Mon, 23 Feb 2004 14:44:05 +1100 kaos (linux-2.6/Z/c/10_unwind.c 1.1.1.2 644) renamed from arch/ia64/kernel/unwind.c Sun, 08 Feb 2004 22:59:56 +1100 kaos (linux-2.6/Z/c/10_unwind.c 1.1.1.2 644) +10 -3
@@ -60,9 +60,16 @@
 
 #ifdef UNW_DEBUG
   static unsigned int unw_debug_level = UNW_DEBUG;
-#  define UNW_DEBUG_ON(n)	unw_debug_level >= n
-   /* Do not code a printk level, not all debug lines end in newline */
-#  define UNW_DPRINT(n, ...)  if (UNW_DEBUG_ON(n)) printk(__VA_ARGS__)
+#  ifdef CONFIG_KDB
+#    include <linux/kdb.h>
+#    define UNW_DEBUG_ON(n)	(unw_debug_level >= n && !KDB_IS_RUNNING())
+#    define UNW_DPRINT(n, ...)	if (UNW_DEBUG_ON(n)) kdb_printf(__VA_ARGS__)
+#  else	/* !CONFIG_KDB */
+#    define UNW_DEBUG_ON(n)	unw_debug_level >= n
+     /* Do not code a printk level, not all debug lines end in newline */
+#    define UNW_DPRINT(n, ...)  if (UNW_DEBUG_ON(n)) printk(__VA_ARGS__)
+#  endif /* CONFIG_KDB */
+#  undef inline
 #  define inline
 #else /* !UNW_DEBUG */
 #  define UNW_DEBUG_ON(n)  0
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> The unwind code in 2.6.3 is missing a debug patch. This Keith> patch is in 2.4.25 and makes it much easier to diagnose Keith> unwind problems. printk output does not appear when Keith> in_interrupt(), kdb_printf output does. This brings 2.6.3 Keith> unwind closer to 2.4.25.

Sorry, but I just don't see why there should be KDB-stuff in unwind.c when KDB isn't part of the official Linux tree.

	--david
#2 lore raw
In reply to Keith Owens
Quoted 10 lines · David Mosberger
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> The unwind code in 2.6.3 is missing a debug patch. This Keith> patch is in 2.4.25 and makes it much easier to diagnose Keith> unwind problems. printk output does not appear when Keith> in_interrupt(), kdb_printf output does. This brings 2.6.3 Keith> unwind closer to 2.4.25.

Sorry, but I just don't see why there should be KDB-stuff in unwind.c when KDB isn't part of the official Linux tree.

You took the same patch for unwind.c in the 2.4 kernel.

#3 lore raw
In reply to Keith Owens
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> On Mon, 23 Feb 2004 12:07:39 -0800,

Quoted 1 line · Keith> David Mosberger <[email protected]> wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> The unwind code in 2.6.3 is missing a debug patch. This Keith> patch is in 2.4.25 and makes it much easier to diagnose Keith> unwind problems. printk output does not appear when Keith> in_interrupt(), kdb_printf output does. This brings 2.6.3 Keith> unwind closer to 2.4.25.

Quoted 2 lines
Quoted 2 lines

Sorry, but I just don't see why there should be KDB-stuff in unwind.c when KDB isn't part of the official Linux tree.

Keith> You took the same patch for unwind.c in the 2.4 kernel.

Well, that was 2.4. I don't recall the details, but like I said, I don't see a good reason for including KDB patches in the default kernel when KDB isn't part of it.

	--david
#4 lore raw
In reply to Keith Owens
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line · David Mosberger

Sorry, but I just don't see why there should be KDB-stuff in unwind.c when KDB isn't part of the official Linux tree.

Keith> You took the same patch for unwind.c in the 2.4 kernel.

David> Well, that was 2.4. I don't recall the details, but like I said, I David> don't see a good reason for including KDB patches in the default David> kernel when KDB isn't part of it.

In case it wasn't clear: if you want things to be in sync, I'd rather ask Bjorn to remove the KDB portions in unwind.c.

	--david
#5 lore raw
In reply to Keith Owens
Quoted 2 lines · David Mosberger

In case it wasn't clear: if you want things to be in sync, I'd rather ask Bjorn to remove the KDB portions in unwind.c.

Trust me, it was clear ;) There are some 2.4 unwind patches in flight right now, once they are sorted I will move the kdb code from unwind.c to the kdb patch.

#6 lore raw
In reply to Keith Owens
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> There are some 2.4 unwind patches in flight right now, once Keith> they are sorted I will move the kdb code from unwind.c to the Keith> kdb patch.

OK. Note that I added an unwind.c fix recently. There is at least one more that needs to be backported from libunwind, but I want to complete the libunwind-testing before doing that.

	--david
#7 lore raw
In reply to Keith Owens
Quoted 1 line · David Mosberger

Note that I added an unwind.c fix recently.

Before or after 2.6.3 was released? All the 2.6.3 unwind bug fixes were included in the sync patch that I sent to Bjorn.

Quoted 3 lines

There is at least
one more that needs to be backported from libunwind, but I want to complete the libunwind-testing before doing that.

One line fix for 2.6.3. include/linux/compiler-gcc3.h defines inline which gives warnings for unwind.c when UNW_DEBUG is defined.

Index: 3.1/arch/ia64/kernel/unwind.c

arch/ia64/kernel/unwind.c Tue, 24 Feb 2004 10:36:33 +1100 kaos (linux-2.6/Z/c/10_unwind.c 1.1.1.2 644) renamed from arch/ia64/kernel/unwind.c Sun, 08 Feb 2004 22:59:56 +1100 kaos (linux-2.6/Z/c/10_unwind.c 1.1.1.2 644) +1 -0
@@ -63,6 +63,7 @@
 #  define UNW_DEBUG_ON(n)	unw_debug_level >= n
    /* Do not code a printk level, not all debug lines end in newline */
 #  define UNW_DPRINT(n, ...)  if (UNW_DEBUG_ON(n)) printk(__VA_ARGS__)
+#  undef inline
 #  define inline
 #else /* !UNW_DEBUG */
 #  define UNW_DEBUG_ON(n)  0
#9 lore raw
In reply to Keith Owens
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Keith Owens

Keith> One line fix for 2.6.3. include/linux/compiler-gcc3.h defines inline Keith> which gives warnings for unwind.c when UNW_DEBUG is defined.

Yeah, that's a feature, actually. It reminds me to turn off UNW_DEBUG before shipping a kernel...

	--david