This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[PATCH 3/5][djprobe] export set_jmp_op() for sharing
- 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>, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, Prasanna S Panchamukhi <prasanna at in dot ibm dot com>, Ingo Molnar <mingo at redhat dot com>, SystemTAP <systemtap at sources dot redhat dot com>
- Cc: Masami Hiramatsu <masami dot hiramatsu dot pt at hitachi dot com>, 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>
- Date: Thu, 19 Oct 2006 18:02:58 +0900
- Subject: [PATCH 3/5][djprobe] export set_jmp_op() for sharing
- Organization: Systems Development Lab., Hitachi, Ltd., Japan
- References: <45338593.6090207@hitachi.com>
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 */