public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Zwane Mwaikambo <zwane@fsmlabs.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	William Lee Irwin III <wli@holomorphy.com>,
	Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH][6/8] Arch agnostic completely out of line locks / arm
Date: Fri, 3 Sep 2004 10:04:56 +0100	[thread overview]
Message-ID: <20040903100456.A7535@flint.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.58.0409021237000.4481@montezuma.fsmlabs.com>; from zwane@fsmlabs.com on Thu, Sep 02, 2004 at 08:02:55PM -0400

On Thu, Sep 02, 2004 at 08:02:55PM -0400, Zwane Mwaikambo wrote:
> --- linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c	26 Aug 2004 13:13:04 -0000	1.1.1.1
> +++ linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c	2 Sep 2004 15:51:37 -0000
> @@ -52,6 +52,18 @@ EXPORT_SYMBOL(rtc_lock);
>  /* change this if you have some constant time drift */
>  #define USECS_PER_JIFFY	(1000000/HZ)
> 
> +#ifdef CONFIG_SMP
> +unsigned long profile_pc(struct pt_regs *regs)
> +{
> +	unsigned long pc = instruction_pointer(regs);
> +
> +	if (pc >= (unsigned long)&__lock_text_start &&
> +	    pc <= (unsigned long)&__lock_text_end)
> +		return regs->ARM_lr;
> +	return pc;
> +}
> +EXPORT_SYMBOL(profile_pc);
> +#endif

Looks good apart from this.  There's no guarantee that LR will be the
return address inside one of these lock functions - indeed the compiler
may have saved it onto the stack and decided to use the register for
something else.

Your best bet is to look at the get_wchan() code which walks the stack
frames (if present.)

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

  reply	other threads:[~2004-09-03  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03  0:02 [PATCH][6/8] Arch agnostic completely out of line locks / arm Zwane Mwaikambo
2004-09-03  9:04 ` Russell King [this message]
2004-09-03 12:09   ` Zwane Mwaikambo

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=20040903100456.A7535@flint.arm.linux.org.uk \
    --to=rmk+lkml@arm.linux.org.uk \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=torvalds@osdl.org \
    --cc=wli@holomorphy.com \
    --cc=zwane@fsmlabs.com \
    /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