public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	David Daney <ddaney@caviumnetworks.com>,
	yrl.pp-manager.tt@hitachi.com
Subject: Re: [PATCH 2/3 v2] kprobes/trace: Fix kprobe selftest for gcc 4.6
Date: Wed, 08 Jun 2011 12:45:30 +0900	[thread overview]
Message-ID: <4DEEF05A.3010007@hitachi.com> (raw)
In-Reply-To: <20110607213007.312394187@goodmis.org>

(2011/06/08 6:29), Steven Rostedt wrote:
> From: Steven Rostedt <srostedt@redhat.com>
> 
> With gcc 4.6, the self test kprobe function:
> 
>  kprobe_trace_selftest_target()
> 
> is optimized such that kallsyms does not list it. The kprobes
> test uses this function to insert a probe and test it. But
> it will fail the test if the function is not listed in kallsyms.
> 
> Adding a __used annotation keeps the symbol in the kallsyms table.

Thanks Steven and David,

That's good to me!

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

> 
> Suggested-by: David Daney <ddaney@caviumnetworks.com>
> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  kernel/trace/trace_kprobe.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
> index f925c45..27d13b3 100644
> --- a/kernel/trace/trace_kprobe.c
> +++ b/kernel/trace/trace_kprobe.c
> @@ -1870,8 +1870,12 @@ fs_initcall(init_kprobe_trace);
>  
>  #ifdef CONFIG_FTRACE_STARTUP_TEST
>  
> -static int kprobe_trace_selftest_target(int a1, int a2, int a3,
> -					int a4, int a5, int a6)
> +/*
> + * The "__used" keeps gcc from removing the function symbol
> + * from the kallsyms table.
> + */
> +static __used int kprobe_trace_selftest_target(int a1, int a2, int a3,
> +					       int a4, int a5, int a6)
>  {
>  	return a1 + a2 + a3 + a4 + a5 + a6;
>  }


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

  reply	other threads:[~2011-06-08  3:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-07 21:29 [PATCH 0/3 v2] [GIT PULL][v3.0] tracing: fixes Steven Rostedt
2011-06-07 21:29 ` [PATCH 1/3 v2] ftrace: Fix possible undefined return code Steven Rostedt
2011-06-07 21:29 ` [PATCH 2/3 v2] kprobes/trace: Fix kprobe selftest for gcc 4.6 Steven Rostedt
2011-06-08  3:45   ` Masami Hiramatsu [this message]
2011-06-07 21:29 ` [PATCH 3/3 v2] ftrace: Revert 8ab2b7efd ftrace: Remove unnecessary disabling of Steven Rostedt
2011-06-07 21:38   ` Richard W.M. Jones
2011-06-07 21:42     ` Steven Rostedt
2011-06-08 14:08 ` [PATCH 0/3 v2] [GIT PULL][v3.0] tracing: fixes Ingo Molnar

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=4DEEF05A.3010007@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=akpm@linux-foundation.org \
    --cc=ddaney@caviumnetworks.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=yrl.pp-manager.tt@hitachi.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