Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm64: ftrace: function_graph: dump real return addr in call trace
Date: Thu, 15 Oct 2015 14:46:16 +0200	[thread overview]
Message-ID: <6277407.jveniKQDxt@wuerfel> (raw)
In-Reply-To: <1444911155-17480-1-git-send-email-huawei.libin@huawei.com>

On Thursday 15 October 2015 20:12:35 Li Bin wrote:
> 
> +#ifdef CONFIG_FUNCTION_GRAPH_TRACER
> +static void print_ftrace_graph_addr(unsigned long addr,
> +                                       struct task_struct *tsk,
> +                                       unsigned long sp, int *graph)
> +{
> +       unsigned long ret_addr;
> +       int index = tsk->curr_ret_stack;
> +
> +       if (addr != ((unsigned long)return_to_handler - 4))
> +               return;
> +
> +       if (!tsk->ret_stack || index < *graph)
> 

I think it would be nicer to remove the #ifdef and write this as

static void print_ftrace_graph_addr(unsigned long addr,
                                    struct task_struct *tsk,
                                    unsigned long sp, int *graph)
{
       unsigned long ret_addr;
       int index = tsk->curr_ret_stack;

       if (!IS_ENABLED(CONFIG_FUNCTION_GRAPH_TRACER))
		return;

       if (addr != ((unsigned long)return_to_handler - 4))
               return;

  reply	other threads:[~2015-10-15 12:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-15 12:12 [PATCH] arm64: ftrace: function_graph: dump real return addr in call trace Li Bin
2015-10-15 12:46 ` Arnd Bergmann [this message]
2015-10-15 12:51   ` Will Deacon
2015-10-15 14:18     ` Steven Rostedt
2015-10-20 15:32       ` Catalin Marinas
2015-10-22  0:55         ` libin
2015-10-22  1:13           ` Steven Rostedt
2015-10-28 15:21           ` Will Deacon

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=6277407.jveniKQDxt@wuerfel \
    --to=arnd@arndb.de \
    --cc=linux-arm-kernel@lists.infradead.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