From: Masami Hiramatsu <mhiramat@redhat.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>,
Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
Jim Keniston <jkenisto@us.ibm.com>,
Roland McGrath <roland@redhat.com>,
Arjan van de Ven <arjan@infradead.org>,
prasanna@in.ibm.com, anil.s.keshavamurthy@intel.com,
davem@davemloft.net, systemtap-ml <systemtap@sources.redhat.com>,
LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/4] x86: add kprobe-booster to X86_64
Date: Tue, 18 Dec 2007 23:43:59 -0500 [thread overview]
Message-ID: <4768A18F.4040406@redhat.com> (raw)
In-Reply-To: <1198031400.7734.41.camel@brick>
Harvey Harrison wrote:
> On Tue, 2007-12-18 at 08:50 -0500, Masami Hiramatsu wrote:
>> Hi Harvey,
>>
>> Thank you for cleaning this up.
>>
>> Harvey Harrison wrote:
>>> Subject: [PATCH] x86: kprobes leftover cleanups
>>>
>>> Eliminate __always_inline, all of these static functions are
>>> only called once. Minor whitespace cleanup. Eliminate one
>>> supefluous return at end of void function. Reverse sense of
>>> #ifndef to be #ifdef to show the case only affects X86_32.
>> Unfortunately, to prevent kprobe recursive call, all functions which
>> is called from kprobes must be inlined or have __kprobes.
>> If __always_inline macro still work, I prefer to use it. If not,
>> it must have a __kprobe attribute like as below.
>
> I thought all static functions that were only called once were
> automatically inlined these days? Otherwise __always_inline and
> inline are exactly the same in the kernel.
Yes, it will be (not obviously) inlined, currently.
However, IMHO, it is not fail-safe coding.
I think we might better take care of someone who will modify the code
in the future. If they call those functions from other place,
it will not be inlined, and may be placed out of .kprobes.text.
In that case, we can not prevent inserting kprobes in those functions.
Thus, I recommend you to add __kprobes on those functions.
That indicates which functions will be used by kprobes and gives
hints how to write functions which will be called from kprobes.
(And also, it simplifies coding rule.)
Thank you,
>
> Harvey
>
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com, masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2007-12-19 4:50 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-17 22:27 [PATCH 3/4] x86: add kprobe-booster to X86_64 Harvey Harrison
2007-12-18 11:29 ` Ingo Molnar
2007-12-18 11:42 ` Harvey Harrison
2007-12-18 13:50 ` Masami Hiramatsu
2007-12-19 2:30 ` Harvey Harrison
2007-12-19 4:43 ` Masami Hiramatsu [this message]
2007-12-19 5:21 ` Harvey Harrison
2007-12-19 5:27 ` [PATCH] x86: __kprobes annotations Harvey Harrison
2007-12-19 5:43 ` Masami Hiramatsu
2007-12-19 9:27 ` Ingo Molnar
2007-12-18 13:58 ` [PATCH 3/4] x86: add kprobe-booster to X86_64 Ingo Molnar
-- strict thread matches above, loose matches on Subject: below --
2007-12-17 21:27 Harvey Harrison
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=4768A18F.4040406@redhat.com \
--to=mhiramat@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=ananth@in.ibm.com \
--cc=anil.s.keshavamurthy@intel.com \
--cc=arjan@infradead.org \
--cc=davem@davemloft.net \
--cc=harvey.harrison@gmail.com \
--cc=jkenisto@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=prasanna@in.ibm.com \
--cc=roland@redhat.com \
--cc=systemtap@sources.redhat.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