This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC][PATCH 0/4][kprobe](djprobe) Direct jump optimized kprobes


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]