diff options
author | Ananth N Mavinakayanahalli <ananth@in.ibm.com> | 2007-05-08 07:28:27 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 18:15:08 (GMT) |
commit | 0f95b7fc839bc3272b1bf2325d8748a649bd3534 (patch) | |
tree | c5cbf5eabc5b58867d7a8949c412163e37182542 /include/linux/kprobes.h | |
parent | 8f0c45cdf87dc9141e87b0ad2fc6fff216a95f79 (diff) | |
download | linux-fsl-qoriq-0f95b7fc839bc3272b1bf2325d8748a649bd3534.tar.xz |
Kprobes: print details of kretprobe on assertion failure
In certain cases like when the real return address can't be found or when
the number of tracked calls to a kretprobed function is less than the
number of returns, we may not be able to find the correct return address
after processing a kretprobe. Currently we just do a BUG_ON, but no
information is provided about the actual failing kretprobe.
Print out details of the kretprobe before calling BUG().
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: Jim Keniston <jkenisto@us.ibm.com>
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
Cc: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kprobes.h')
-rw-r--r-- | include/linux/kprobes.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index f264607..850ee87 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h @@ -157,6 +157,16 @@ struct kretprobe_instance { struct task_struct *task; }; +static inline void kretprobe_assert(struct kretprobe_instance *ri, + unsigned long orig_ret_address, unsigned long trampoline_address) +{ + if (!orig_ret_address || (orig_ret_address == trampoline_address)) { + printk("kretprobe BUG!: Processing kretprobe %p @ %p\n", + ri->rp, ri->rp->kp.addr); + BUG(); + } +} + extern spinlock_t kretprobe_lock; extern struct mutex kprobe_mutex; extern int arch_prepare_kprobe(struct kprobe *p); |