Commit e65cefe8 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] kernel/kprobes.c: fix a warning #ifndef ARCH_SUPPORTS_KRETPROBES

kernel/kprobes.c:353: warning: 'pre_handler_kretprobe' defined but not used
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarAnanth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: default avatar"Keshavamurthy, Anil S" <anil.s.keshavamurthy@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 8ed75463
...@@ -344,23 +344,6 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) ...@@ -344,23 +344,6 @@ void __kprobes kprobe_flush_task(struct task_struct *tk)
spin_unlock_irqrestore(&kretprobe_lock, flags); spin_unlock_irqrestore(&kretprobe_lock, flags);
} }
/*
* This kprobe pre_handler is registered with every kretprobe. When probe
* hits it will set up the return probe.
*/
static int __kprobes pre_handler_kretprobe(struct kprobe *p,
struct pt_regs *regs)
{
struct kretprobe *rp = container_of(p, struct kretprobe, kp);
unsigned long flags = 0;
/*TODO: consider to only swap the RA after the last pre_handler fired */
spin_lock_irqsave(&kretprobe_lock, flags);
arch_prepare_kretprobe(rp, regs);
spin_unlock_irqrestore(&kretprobe_lock, flags);
return 0;
}
static inline void free_rp_inst(struct kretprobe *rp) static inline void free_rp_inst(struct kretprobe *rp)
{ {
struct kretprobe_instance *ri; struct kretprobe_instance *ri;
...@@ -578,6 +561,23 @@ void __kprobes unregister_jprobe(struct jprobe *jp) ...@@ -578,6 +561,23 @@ void __kprobes unregister_jprobe(struct jprobe *jp)
#ifdef ARCH_SUPPORTS_KRETPROBES #ifdef ARCH_SUPPORTS_KRETPROBES
/*
* This kprobe pre_handler is registered with every kretprobe. When probe
* hits it will set up the return probe.
*/
static int __kprobes pre_handler_kretprobe(struct kprobe *p,
struct pt_regs *regs)
{
struct kretprobe *rp = container_of(p, struct kretprobe, kp);
unsigned long flags = 0;
/*TODO: consider to only swap the RA after the last pre_handler fired */
spin_lock_irqsave(&kretprobe_lock, flags);
arch_prepare_kretprobe(rp, regs);
spin_unlock_irqrestore(&kretprobe_lock, flags);
return 0;
}
int __kprobes register_kretprobe(struct kretprobe *rp) int __kprobes register_kretprobe(struct kretprobe *rp)
{ {
int ret = 0; int ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment