Skip to contentSkip to conversation

kprobes: add (un)register_kprobes for batch registration

PATCH In review Masami Hiramatsu 1 participant 1 message Mar 14, 2008 kprobes

lore
Share & tools
lore
#0 lore raw

PATCH 2/5 kprobes: add (un)register_kprobes for batch registration

Introduce unregister_/register_kprobes() for kprobe batch registration. This can reduce waiting time for synchronized_sched() when a lot of probes have to be unregistered at once.

---
I rewrote a patchset which had been discussed on LKML, and simplified its interfaces.
http://lkml.org/lkml/2007/3/23/181

 include/linux/kprobes.h |    9 +++
 kernel/kprobes.c        |  124 +++++++++++++++++++++++++++++++++---------------
 2 files changed, 96 insertions(+), 37 deletions(-)
include/linux/kprobes.h +9 -0
Index: 2.6.25-rc5-mm1/include/linux/kprobes.h
===================================================================
@@ -234,6 +234,8 @@ static inline struct kprobe_ctlblk *get_
 
 int register_kprobe(struct kprobe *p);
 void unregister_kprobe(struct kprobe *p);
+int register_kprobes(struct kprobe **kps, int num);
+void unregister_kprobes(struct kprobe **kps, int num);
 int setjmp_pre_handler(struct kprobe *, struct pt_regs *);
 int longjmp_break_handler(struct kprobe *, struct pt_regs *);
 int register_jprobe(struct jprobe *p);
@@ -261,9 +263,16 @@ static inline int register_kprobe(struct
 {
 	return -ENOSYS;
 }
+static inline int register_kprobes(struct kprobe **kps, int num)
+{
+	return -ENOSYS;
+}
 static inline void unregister_kprobe(struct kprobe *p)
 {
 }
+static inline void unregister_kprobes(struct kprobe **kps, int num)
+{
+}
 static inline int register_jprobe(struct jprobe *p)
 {
 	return -ENOSYS;
kernel/kprobes.c +87 -37

177 lines not on this page · raw message

Signature · 7 lines
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: [email protected]