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]

[PATCH 3/5][djprobe] export set_jmp_op() for sharing


Hi,

The kprobe-booster uses set_jmp_op() function, and the djprobe also
uses it. So this patch exports this function for sharing code.

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

---
 arch/i386/kernel/kprobes.c |   12 ------------
 include/asm-i386/kprobes.h |   12 ++++++++++++
 2 files changed, 12 insertions(+), 12 deletions(-)

Index: linux-2.6.18/arch/i386/kernel/kprobes.c
===================================================================
--- linux-2.6.18.orig/arch/i386/kernel/kprobes.c	2006-09-29 14:40:16.000000000 +0900
+++ linux-2.6.18/arch/i386/kernel/kprobes.c	2006-09-29 14:52:15.000000000 +0900
@@ -41,18 +41,6 @@
 DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
 DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);

-/* insert a jmp code */
-static __always_inline void set_jmp_op(void *from, void *to)
-{
-	struct __arch_jmp_op {
-		char op;
-		long raddr;
-	} __attribute__((packed)) *jop;
-	jop = (struct __arch_jmp_op *)from;
-	jop->raddr = (long)(to) - ((long)(from) + 5);
-	jop->op = RELATIVEJUMP_INSTRUCTION;
-}
-
 /*
  * returns non-zero if opcodes can be boosted.
  */
Index: linux-2.6.18/include/asm-i386/kprobes.h
===================================================================
--- linux-2.6.18.orig/include/asm-i386/kprobes.h	2006-09-29 14:40:09.000000000 +0900
+++ linux-2.6.18/include/asm-i386/kprobes.h	2006-09-29 16:55:52.000000000 +0900
@@ -88,6 +88,18 @@
 		local_irq_enable();
 }

+/* Insert a jmp code */
+static __always_inline void set_jmp_op(void *from, void *to)
+{
+	struct __arch_jmp_op {
+		char op;
+		long raddr;
+	} __attribute__((packed)) *jop;
+	jop = (struct __arch_jmp_op *)from;
+	jop->raddr = (long)(to) - ((long)(from) + 5);
+	jop->op = RELATIVEJUMP_INSTRUCTION;
+}
+
 extern int kprobe_exceptions_notify(struct notifier_block *self,
 				    unsigned long val, void *data);
 #endif				/* _ASM_KPROBES_H */








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