diff --git a/Makefile b/Makefile index 851a31f8..44005ea9 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ $(MODULE).o: $(MODULE).c $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules else -MODCFLAGS += KERNEL24 +MODCFLAGS += -DKERNEL24 $(MODULE).o: $(MODULE).c gcc $(MODCFLAGS) $(MODULE).c -c -o$(MODULE).o diff --git a/sysprof-module.c b/sysprof-module.c index 284873ff..5d85fbac 100644 --- a/sysprof-module.c +++ b/sysprof-module.c @@ -45,6 +45,7 @@ static struct tq_struct timer_task = NULL }; +int exiting = 0; #else static struct timer_list timer; @@ -162,12 +163,12 @@ on_timer(unsigned long dong) ) { - struct pt_regs *regs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) current->thread_info)) - 1; -#if 0 +#ifdef KERNEL24 struct pt_regs *regs = (struct pt_regs *)( - (long)current + THREAD_SIZE - sizeof (struct pt_regs)); + (long)current + THREAD_SIZE - sizeof (struct pt_regs)); +#else + struct pt_regs *regs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) current->thread_info)) - 1; #endif - generate_stack_trace (regs, head); if (head++ == &stack_traces[N_TRACES - 1])