aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRusty Lynch <rusty.lynch@intel.com>2005-06-27 18:17:12 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-27 18:23:53 -0400
commit9508dbfe39112813612085c00d55bacd398eddc6 (patch)
tree5f1cac16508284f54d7402f71bebf085c4bf2e7f /include
parentba8af12f432c4f00ddb0bc1068b57b20aac93ecf (diff)
[PATCH] Return probe redesign: ia64 specific implementation
The following patch implements function return probes for ia64 using the revised design. With this new design we no longer need to do some of the odd hacks previous required on the last ia64 return probe port that I sent out for comments. Note that this new implementation still does not resolve the problem noted by Keith Owens where backtrace data is lost after a return probe is hit. Changes include: * Addition of kretprobe_trampoline to act as a dummy function for instrumented functions to return to, and for the return probe infrastructure to place a kprobe on on, gaining control so that the return probe handler can be called, and so that the instruction pointer can be moved back to the original return address. * Addition of arch_init(), allowing a kprobe to be registered on kretprobe_trampoline * Addition of trampoline_probe_handler() which is used as the pre_handler for the kprobe inserted on kretprobe_implementation. This is the function that handles the details for calling the return probe handler function and returning control back at the original return address * Addition of arch_prepare_kretprobe() which is setup as the pre_handler for a kprobe registered at the beginning of the target function by kernel/kprobes.c so that a return probe instance can be setup when a caller enters the target function. (A return probe instance contains all the needed information for trampoline_probe_handler to do it's job.) * Hooks added to the exit path of a task so that we can cleanup any left-over return probe instances (i.e. if a task dies while inside a targeted function then the return probe instance was reserved at the beginning of the function but the function never returns so we need to mark the instance as unused.) Signed-off-by: Rusty Lynch <rusty.lynch@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-ia64/kprobes.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/asm-ia64/kprobes.h b/include/asm-ia64/kprobes.h
index 25d8b1edfcba..bf36a32e37e4 100644
--- a/include/asm-ia64/kprobes.h
+++ b/include/asm-ia64/kprobes.h
@@ -64,6 +64,8 @@ typedef struct _bundle {
64 64
65#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry 65#define JPROBE_ENTRY(pentry) (kprobe_opcode_t *)pentry
66 66
67#define ARCH_SUPPORTS_KRETPROBES
68
67#define SLOT0_OPCODE_SHIFT (37) 69#define SLOT0_OPCODE_SHIFT (37)
68#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46)) 70#define SLOT1_p1_OPCODE_SHIFT (37 - (64-46))
69#define SLOT2_OPCODE_SHIFT (37) 71#define SLOT2_OPCODE_SHIFT (37)
@@ -95,11 +97,6 @@ struct arch_specific_insn {
95}; 97};
96 98
97/* ia64 does not need this */ 99/* ia64 does not need this */
98static inline void jprobe_return(void)
99{
100}
101
102/* ia64 does not need this */
103static inline void arch_copy_kprobe(struct kprobe *p) 100static inline void arch_copy_kprobe(struct kprobe *p)
104{ 101{
105} 102}
@@ -107,6 +104,12 @@ static inline void arch_copy_kprobe(struct kprobe *p)
107#ifdef CONFIG_KPROBES 104#ifdef CONFIG_KPROBES
108extern int kprobe_exceptions_notify(struct notifier_block *self, 105extern int kprobe_exceptions_notify(struct notifier_block *self,
109 unsigned long val, void *data); 106 unsigned long val, void *data);
107
108/* ia64 does not need this */
109static inline void jprobe_return(void)
110{
111}
112
110#else /* !CONFIG_KPROBES */ 113#else /* !CONFIG_KPROBES */
111static inline int kprobe_exceptions_notify(struct notifier_block *self, 114static inline int kprobe_exceptions_notify(struct notifier_block *self,
112 unsigned long val, void *data) 115 unsigned long val, void *data)