public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 2/3] sh: Function graph tracer support
Date: Sat, 11 Jul 2009 01:43:06 +0000	[thread overview]
Message-ID: <20090711014306.GB26706@linux-sh.org> (raw)
In-Reply-To: <b3aec4e1eb69eea102622f1bb30bd45608c4e787.1247272091.git.matt@console-pimps.org>

On Sat, Jul 11, 2009 at 01:29:03AM +0100, Matt Fleming wrote:
> Add both dynamic and static function graph tracer support for sh.

On Sat, Jul 11, 2009 at 01:29:04AM +0100, Matt Fleming wrote:
> Annotate __switch_to() so that the function graph tracer does not try to
> trace it. Use __notrace_funcgraph, as opposed to notrace, so that other
> tracers can continue to trace __switch_to().
> 
> The reason that we don't want to trace __switch_to() with the function
> graph tracer is because of how the return address stack in task_struct
> is implemented. When we enter __switch_to we store the real return
> address on prev's ret_stack. When we return from __switch_to() we've
> patched the return address on the kernel stack to be
> return_to_handler. Calling return_to_handler we do,
> 
>        -> ftrace_return_to_handler()
>        	  -> ftrace_pop_return_ftrace()
> 
> Which tries to pop the real return address from current->ret_stack. The
> problem being that we stored the return address on prev->ret_stack, but
> current now points to next, and next->ret_stack doesn't contain the
> correct return address (and is possibly even empty).

On Sat, Jul 11, 2009 at 02:00:23AM +0100, Matt Fleming wrote:
> Enable kernel stack checking code in both the dynamic ftrace and mcount
> code paths. Check the stack to see if it's overflowing and make sure
> that the stack pointer contains an address that's either in init_stack
> or after the bss.

All applied with some minor tidying, thanks!

      reply	other threads:[~2009-07-11  1:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11  0:29 [PATCH 2/3] sh: Function graph tracer support Matt Fleming
2009-07-11  1:43 ` Paul Mundt [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=20090711014306.GB26706@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@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