mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Keith Owens <kaos@ocs.com.au>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [patch] improve wchan reporting
Date: Sat, 05 Oct 2002 00:10:53 +1000	[thread overview]
Message-ID: <4003.1033740653@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Thu, 03 Oct 2002 18:21:44 -0400." <20021003182144.G16875@redhat.com>

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;?


      parent reply	other threads:[~2002-10-04 14:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 22:21 Benjamin LaHaise
2002-10-03 22:30 ` Rik van Riel
2002-10-03 22:48   ` Benjamin LaHaise
2002-10-04 14:10 ` Keith Owens [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4003.1033740653@ocs3.intra.ocs.com.au \
    --to=kaos@ocs.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®