From: Andrew Morton Signed-off-by: Andrew Morton --- arch/i386/Kconfig.kgdb | 33 ------------ arch/i386/kernel/kgdb_stub.c | 85 --------------------------------- include/asm-i386/kgdb.h | 11 ---- 3 files changed, 1 insertion(+), 128 deletions(-) diff -puN arch/i386/Kconfig.kgdb~kgdb-remove-KGDB_TS arch/i386/Kconfig.kgdb --- devel/arch/i386/Kconfig.kgdb~kgdb-remove-KGDB_TS 2006-02-27 02:43:42.000000000 -0800 +++ devel-akpm/arch/i386/Kconfig.kgdb 2006-02-27 02:43:42.000000000 -0800 @@ -64,39 +64,6 @@ config KGDB_IRQ correctly and the kernel has interrupts on a control C to the port should cause a break into the kernel debug stub. -config KGDB_TS - bool "Enable kgdb time stamp macros?" - depends on KGDB - default n - help - Kgdb event macros allow you to instrument your code with calls - to the kgdb event recording function. The event log may be - examined with gdb at a break point. Turning on this - capability also allows you to choose how many events to - keep. Kgdb always keeps the lastest events. - -choice - depends on KGDB_TS - prompt "Max number of time stamps to save?" - default KGDB_TS_128 - -config KGDB_TS_64 - bool "64" - -config KGDB_TS_128 - bool "128" - -config KGDB_TS_256 - bool "256" - -config KGDB_TS_512 - bool "512" - -config KGDB_TS_1024 - bool "1024" - -endchoice - config STACK_OVERFLOW_TEST bool "Turn on kernel stack overflow testing?" depends on KGDB diff -puN arch/i386/kernel/kgdb_stub.c~kgdb-remove-KGDB_TS arch/i386/kernel/kgdb_stub.c --- devel/arch/i386/kernel/kgdb_stub.c~kgdb-remove-KGDB_TS 2006-02-27 02:43:42.000000000 -0800 +++ devel-akpm/arch/i386/kernel/kgdb_stub.c 2006-02-27 02:43:42.000000000 -0800 @@ -1984,90 +1984,7 @@ void kgdb_console_finit(void) } #endif #endif -#ifdef CONFIG_KGDB_TS -#include /* time stamp code */ -#include /* in_interrupt */ -#ifdef CONFIG_KGDB_TS_64 -#define DATA_POINTS 64 -#endif -#ifdef CONFIG_KGDB_TS_128 -#define DATA_POINTS 128 -#endif -#ifdef CONFIG_KGDB_TS_256 -#define DATA_POINTS 256 -#endif -#ifdef CONFIG_KGDB_TS_512 -#define DATA_POINTS 512 -#endif -#ifdef CONFIG_KGDB_TS_1024 -#define DATA_POINTS 1024 -#endif -#ifndef DATA_POINTS -#define DATA_POINTS 128 /* must be a power of two */ -#endif -#define INDEX_MASK (DATA_POINTS - 1) -#if (INDEX_MASK & DATA_POINTS) -#error "CONFIG_KGDB_TS_COUNT must be a power of 2" -#endif -struct kgdb_and_then_struct { -#ifdef CONFIG_SMP - int on_cpu; -#endif - struct task_struct *task; - long long at_time; - int from_ln; - char *in_src; - void *from; - int *with_shpf; - int data0; - int data1; -}; -struct kgdb_and_then_struct2 { -#ifdef CONFIG_SMP - int on_cpu; -#endif - struct task_struct *task; - long long at_time; - int from_ln; - char *in_src; - void *from; - int *with_shpf; - struct task_struct *t1; - struct task_struct *t2; -}; -struct kgdb_and_then_struct kgdb_data[DATA_POINTS]; - -struct kgdb_and_then_struct *kgdb_and_then = &kgdb_data[0]; -int kgdb_and_then_count; - -void -kgdb_tstamp(int line, char *source, int data0, int data1) -{ - static spinlock_t ts_spin = SPIN_LOCK_UNLOCKED; - int flags; - local_irq_save(flags); - spin_lock(&ts_spin); - rdtscll(kgdb_and_then->at_time); -#ifdef CONFIG_SMP - kgdb_and_then->on_cpu = smp_processor_id(); -#endif - kgdb_and_then->task = current; - kgdb_and_then->from_ln = line; - kgdb_and_then->in_src = source; - kgdb_and_then->from = __builtin_return_address(0); - kgdb_and_then->with_shpf = (int *) (((flags & IF_BIT) >> 9) | - (preempt_count() << 8)); - kgdb_and_then->data0 = data0; - kgdb_and_then->data1 = data1; - kgdb_and_then = &kgdb_data[++kgdb_and_then_count & INDEX_MASK]; - spin_unlock(&ts_spin); - local_irq_restore(flags); -#ifdef CONFIG_PREEMPT -#endif - return; -} -#endif typedef int gdb_debug_hook(int exceptionVector, - int signo, int err_code, struct pt_regs *linux_regs); + int signo, int err_code, struct pt_regs *linux_regs); gdb_debug_hook *linux_debug_hook = &kgdb_handle_exception; diff -puN include/asm-i386/kgdb.h~kgdb-remove-KGDB_TS include/asm-i386/kgdb.h --- devel/include/asm-i386/kgdb.h~kgdb-remove-KGDB_TS 2006-02-27 02:43:42.000000000 -0800 +++ devel-akpm/include/asm-i386/kgdb.h 2006-02-27 02:43:42.000000000 -0800 @@ -35,17 +35,6 @@ extern int kgdb_handle_exception(int tra int signo, int err_code, struct pt_regs *regs); extern int in_kgdb(struct pt_regs *regs); -#ifdef CONFIG_KGDB_TS -void kgdb_tstamp(int line, char *source, int data0, int data1); -/* - * This is the time stamp function. The macro adds the source info and - * does a cast on the data to allow most any 32-bit value. - */ - -#define kgdb_ts(data0,data1) kgdb_tstamp(__LINE__,__FILE__,(int)data0,(int)data1) -#else -#define kgdb_ts(data0,data1) -#endif #else /* CONFIG_KGDB && ! __ASSEMBLY__ ,stubs follow... */ #ifndef BREAKPOINT #define BREAKPOINT _