This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[RFC][PATCH 0/4][kprobe](djprobe) Direct jump optimized kprobes
- From: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>
- To: "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, Ingo Molnar <mingo at redhat dot com>, SystemTAP <systemtap at sources dot redhat dot com>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Prasanna S Panchamukhi <prasanna at in dot ibm dot com>
- Cc: Satoshi Oshima <soshima at redhat dot com>, Hideo Aoki <haoki at redhat dot com>, Yumiko Sugita <yumiko dot sugita dot yf at hitachi dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, Martin Bligh <mbligh at google dot com>, Greg Kroah-Hartman <gregkh at suse dot de>
- Date: Tue, 21 Nov 2006 15:48:48 +0900
- Subject: [RFC][PATCH 0/4][kprobe](djprobe) Direct jump optimized kprobes
- Organization: Systems Development Lab., Hitachi, Ltd., Japan
Hi Anil and Ingo,
I integrated the essence of the djprobe into kprobes. For this
purpose, I introduced the length member in the kprobe structure.
If you'd like to use it, specify the length of the instructions
which will be replaced by a jump code to that length member.
(Of cause, you also have to check whether the instructions are
relocatable and don't include any jump target.)
There are some limitations if you specify the length.
- Must not specify the post_handler and the break_handler.
Djprobe doesn't support those handlers.
- Must not modify EIP in the pre_handler.
This modified EIP is just ignored.
And some behavior of kprobes will change.
- If you insert a kprobe in where another djprobe is already
inserted in, it will become one probe of the multi-probes of
the djprobe.
In this case, if the kprobe has a post_handler or a break_handler,
register_kprobe() will return -EEXIST and fail to register it.
- On the other hand, if you insert a djprobe in where another
kprobe is already inserted in, it will become one probe of
the multi-probes of the kprobe. This will never fail.
- If you insert a kprobe in the middle of the jump code which has
inserted by another djprobe, register_kprobe() will return
-EEXIST and fail to register it.
From the user's point of view, it just seems to be optimized by
invoking commit_kprobes() if user sets the length member of kprobe.
So I call it the Direct Jump Optimized kprobes ("djprobe" for short).
NOTE: The patches following this mail depends on my previous patch
(kprobes-enable-booster-on-the-preemptible-kernel.patch).
http://sources.redhat.com/ml/systemtap/2006-q4/msg00453.html
Best Regards,
P.S. Kretprobe is also optimized by this patch.
---
Masami HIRAMATSU
Linux Technology Center
Hitachi, Ltd., Systems Development Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com