samples/kprobes: Add __kprobes and NOKPROBE_SYMBOL() for handlers.
Add __kprobes and NOKPROBE_SYMBOL() for sample kprobe handlers. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com> Acked-by: Peter Zijlstra <peterz@infradead.org> Link: https://lkml.kernel.org/r/20200505134059.878578033@linutronix.de
This commit is contained in:

committed by
Thomas Gleixner

parent
16db6264c9
commit
d85eaa9411
@@ -48,6 +48,7 @@ static int entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
|
||||
data->entry_stamp = ktime_get();
|
||||
return 0;
|
||||
}
|
||||
NOKPROBE_SYMBOL(entry_handler);
|
||||
|
||||
/*
|
||||
* Return-probe handler: Log the return value and duration. Duration may turn
|
||||
@@ -67,6 +68,7 @@ static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
|
||||
func_name, retval, (long long)delta);
|
||||
return 0;
|
||||
}
|
||||
NOKPROBE_SYMBOL(ret_handler);
|
||||
|
||||
static struct kretprobe my_kretprobe = {
|
||||
.handler = ret_handler,
|
||||
|
Reference in New Issue
Block a user