kdb
[Top] [All Lists]

Re: new kdb-4.1 patch for linux-2.5.68

To: Jim Houston <jim.houston@xxxxxxxxx>
Subject: Re: new kdb-4.1 patch for linux-2.5.68
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 1 May 2003 21:18:34 +0100
Cc: kaos@xxxxxxx, kdb@xxxxxxxxxxx, jim.houston@xxxxxxxx
In-reply-to: <3EB17492.A84EE6B6@attbi.com>; from jim.houston@attbi.com on Thu, May 01, 2003 at 03:25:06PM -0400
References: <3EB17492.A84EE6B6@attbi.com>
Sender: kdb-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
A few comments:


diff -urN -X dontdiff linux-2.5.68.orig/Makefile linux-2.5.68/Makefile
--- linux-2.5.68.orig/Makefile  Thu Apr 24 10:46:50 2003
+++ linux-2.5.68/Makefile       Tue Apr 29 09:15:17 2003
@@ -170,8 +170,8 @@
                        else echo rpm; fi)
 GENKSYMS       = scripts/genksyms/genksyms
 DEPMOD         = /sbin/depmod
-KALLSYMS       = scripts/kallsyms

This doesn't seem to be related to kdb, what about sending it
directly to Kai/Linus?

 NOSTDINC_FLAGS  = -nostdinc -iwithprefix include
 
 CPPFLAGS       := -D__KERNEL__ -Iinclude
+CPPFLAGS       += $(patsubst %,-I%,$(CROSS_COMPILE_INC))
 CFLAGS                 := $(CPPFLAGS) -Wall -Wstrict-prototypes -Wno-trigraphs 
-O2 \
                   -fno-strict-aliasing -fno-common
 AFLAGS         := -D__ASSEMBLY__ $(CPPFLAGS)

Not needed anymore.
 
@@ -238,9 +239,14 @@
 
 endif
 
+ifndef CONFIG_FRAME_POINTER
+CFLAGS         += -fomit-frame-pointer
+endif
+

The makefile aready contains that in a different place.

 include arch/$(ARCH)/Makefile
 
 core-y         += kernel/ mm/ fs/ ipc/ security/ crypto/
+core-$(CONFIG_KDB) += kdb/

Please add this to core-y and make the objects conditional in
kdb/Makefile.  This is not a funtional requirement but the style
used by the other makefiles.

--- linux-2.5.68.orig/arch/i386/Kconfig Thu Apr 24 10:46:50 2003
+++ linux-2.5.68/arch/i386/Kconfig      Thu Apr 24 17:30:44 2003
@@ -1505,12 +1505,78 @@
          This options enables addition error checking for high memory systems.
          Disable for production systems.
 
+config FRAME_POINTER
+       bool "Compile the kernel with frame pointers"
+       depends on DEBUG_KERNEL
+       help
+         If you say Y here, the resulting kernel will be slightly larger and
+         slower, but it will give very useful debugging information. If you
+         don't debug the kernel, you can say N, but we may not be able to
+         solve problems without frame pointers.

Again, this option already exists :)

+if KDB = y
+config KALLSYMS
+       bool
+       default y
+comment "KALLSYMS is required for KDB"
+endif
+
+if KDB = n
 config KALLSYMS
        bool "Load all symbols for debugging/kksymoops"
        help
          Say Y here to let the kernel print out symbolic crash information and
          symbolic stack backtraces. This increases the size of the kernel
          somewhat, as all symbols have to be loaded into the kernel image.
+endif

Maybe just add a default y if KDB line?

--- linux-2.5.68.orig/arch/i386/kdb/pc_keyb.h   Wed Dec 31 19:00:00 1969
+++ linux-2.5.68/arch/i386/kdb/pc_keyb.h        Fri Apr 25 09:10:54 2003

This file is gone for a reason..  Why do you think you need it?

diff -urN -X dontdiff linux-2.5.68.orig/include/linux/sched.h 
linux-2.5.68/include/linux/sched.h
--- linux-2.5.68.orig/include/linux/sched.h     Thu Apr 24 10:47:07 2003
+++ linux-2.5.68/include/linux/sched.h  Mon Apr 28 09:22:54 2003
@@ -672,6 +672,31 @@
 
 extern task_t * FASTCALL(next_thread(task_t *p));
 
+#ifdef  CONFIG_KDB
+/*
+ * kdb needs its own version of do_each_thread/while_each_thread
+ * to avoid the lock debug.  It should also evolve to do sanity checks
+ * on the pointers it follows.

Shouldn't this be in a kdb header?

+#ifdef CONFIG_KDB
+static int __init kdb_setup(char *str)
+{
+       /* kdb, kdb=on, kdb=off, kdb=early */
+       if (strcmp(str, "on") == 0) {
+               kdb_on = 1;
+       } else if (strcmp(str, "off") == 0) {
+               kdb_on = 0;
+       } else if (strcmp(str, "early") == 0) {
+               kdb_on = 1;
+               kdb_flags |= KDB_FLAG_EARLYKDB;
+       } else
+               printk("Boot flag %s not recognised\n", str);
+}
+__setup("kdb=", kdb_setup);
+#endif /* CONFIG_KDB */

This should move into a kdb file, too.


<Prev in Thread] Current Thread [Next in Thread>