mirror of https://lore.kernel.org/lkml/
 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>,
	Thomas Gleixner <tglx@linutronix.de>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: [RFC][PATCH 0/4] ftrace: Use -mfentry when supported (this is for x86_64 right now)
Date: Thu, 17 Feb 2011 21:37:06 +0900	[thread overview]
Message-ID: <4D5D1672.6070206@hitachi.com> (raw)
In-Reply-To: <20110209200249.111932716@goodmis.org>

(2011/02/10 5:02), Steven Rostedt wrote:
> Thanks to Andi Kleen gcc 4.6.0 now supports -mfentry with the -pg option
> to place a call to __fentry__ at the very beginning of the function
> instead of after the fact.
> 
> The old way:
> 
> 00000000000000c4 <atomic_long_add>:
>       c4:       55                      push   %rbp
>       c5:       48 89 e5                mov    %rsp,%rbp
>       c8:       e8 00 00 00 00          callq  cd <atomic_long_add+0x9>
>                         c9: R_X86_64_PC32       mcount-0x4
>       cd:       f0 48 01 3e             lock add %rdi,(%rsi)
>       d1:       c9                      leaveq 
>       d2:       c3                      retq   
> 
> The new way:
> 
> 000000000000009e <atomic_long_add>:
>       9e:       e8 00 00 00 00          callq  a3 <atomic_long_add+0x5>
>                         9f: R_X86_64_PC32       __fentry__-0x4
>       a3:       55                      push   %rbp
>       a4:       48 89 e5                mov    %rsp,%rbp
>       a7:       f0 48 01 3e             lock add %rdi,(%rsi)
>       ab:       5d                      pop    %rbp
>       ac:       c3                      retq   
> 
> Note, with -mfentry, frame pointers is no longer required
> by the function tracer. But this patch series still requires
> FRAME_POINTER to be set, since I need to figure out a good way to
> enable FRAME_POINTER only if gcc doesn't support this. But that can
> come later.
> 
> With the new __fentry__, we could possible record the parameters
> of a function call. This may take some work, and perhaps be
> a little like kprobes. But it is doable.
> 
> This is still just RFC. I only wrote the code to support x86_64
> even though gcc 4.6.0 also supports i386. I figured I would post
> this first to get peoples reactions before converting
> i386 too. Other archs can soon follow.

Oops! with this change, current kprobes might not be able to probe
the entry of functions, because that is always reserved by ftrace!
I think we need to have some new interface for replacing each other
safely...

Thank you,

-- 
Masami HIRAMATSU
2nd Dept. Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com

  parent reply	other threads:[~2011-02-17 12:37 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 20:02 Steven Rostedt
2011-02-09 20:02 ` [RFC][PATCH 1/4] ftrace: Make recordmcount.c handle __fentry__ Steven Rostedt
2011-02-09 20:02 ` [RFC][PATCH 2/4] ftrace: Add -mfentry to Makefile on function tracer Steven Rostedt
2011-02-09 20:28   ` Steven Rostedt
2011-02-09 21:22     ` H. Peter Anvin
2011-02-09 20:02 ` [RFC][PATCH 3/4] ftrace: Do not test frame pointers if -mfentry is used Steven Rostedt
2011-02-09 20:02 ` [RFC][PATCH 4/4] ftrace/x86: Add support for -mfentry to x86_64 Steven Rostedt
2011-02-10  2:38 ` [RFC][PATCH 0/4] ftrace: Use -mfentry when supported (this is for x86_64 right now) Masami Hiramatsu
2011-02-17 12:37 ` Masami Hiramatsu [this message]
2011-02-17 13:18   ` Steven Rostedt
2011-02-17 15:34     ` Masami Hiramatsu
2011-02-17 15:46       ` Steven Rostedt
2011-02-17 16:07         ` Masami Hiramatsu
2011-02-17 20:11           ` Steven Rostedt
2011-02-18 11:45             ` Masami Hiramatsu
2011-02-18 15:07               ` Steven Rostedt
2011-02-18 15:19                 ` Mathieu Desnoyers
2011-02-18 20:10                   ` Dominique Toupin
2011-02-18 20:36                     ` Steven Rostedt
2011-02-18 21:45                       ` Dominique Toupin
2011-02-18 22:39                     ` Andi Kleen
2011-02-18 22:45                       ` H. Peter Anvin
2011-02-18 23:02                         ` Steven Rostedt
2011-02-19  5:07                           ` Masami Hiramatsu
2011-02-19  5:10                           ` hpas

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=4D5D1672.6070206@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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

Powered by JetHome