Re: [patch] improve wchan reporting

From: Keith Owens (kaos@ocs.com.au)
Date: Fri Oct 04 2002 - 09:10:53 EST


On Thu, 3 Oct 2002 18:21:44 -0400,
Benjamin LaHaise <bcrl@redhat.com> wrote:
>This patch attempts to fix up the way that wchan is reported on x86 by
>allowing functions out side of schedule.c to be skipped over when reading
>the stack.
>
>diff -urN linus-2.5/arch/i386/kernel/process.c test/arch/i386/kernel/process.c
>--- linus-2.5/arch/i386/kernel/process.c Thu Oct 3 15:30:12 2002
>+++ test/arch/i386/kernel/process.c Thu Oct 3 18:05:13 2002
>+ /* Our first attempt is to walk the chain of frame pointers. */
> do {
>- if (ebp < stack_page || ebp > 8184+stack_page)
>- return 0;
>+ if (ebp < stack_page || ebp > 8188+stack_page)
>+ break;

Use THREAD_SIZE-4 instead of 8188. Some people like 4K stacks.

> eip = *(unsigned long *) (ebp+4);
>+ if (eip < text_start || eip > text_end)
>+ break;

Will incorrectly abort on schedule() called from modules. eip will be
in the vmalloc area for modules on most architectures.

>diff -urN linus-2.5/arch/i386/vmlinux.lds.S test/arch/i386/vmlinux.lds.S
>--- linus-2.5/arch/i386/vmlinux.lds.S Thu Oct 3 15:30:12 2002
>+++ test/arch/i386/vmlinux.lds.S Thu Oct 3 18:05:13 2002
>@@ -11,8 +11,17 @@
> _text = .; /* Text and read-only data */
> .text : {
> *(.text)

Add . = ALIGN(16); here. Text may not end on a quad 16 byte boundary.

>+
>+ scheduling_functions_start_here = .;
>+ . += 0x10;
>+ *(.text.scheduler)

Why . += 0x10;?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 07 2002 - 22:00:44 EST