Commit 61341314 authored by Huang Shijie's avatar Huang Shijie Committed by Linus Torvalds

samples/kretprobe: convert the printk to pr_info/pr_err

We prefer to use the pr_* to print out the log now, this patch converts
the printk to pr_info.  In the error path, use the pr_err to replace the

Link: default avatarHuang Shijie <>
Cc: Petr Mladek <>
Cc: Steve Capper <>
Cc: Ananth N Mavinakayanahalli <>
Cc: Anil S Keshavamurthy <>
Cc: Masami Hiramatsu <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 468b8895
......@@ -62,7 +62,7 @@ static int ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs)
now = ktime_get();
delta = ktime_to_ns(ktime_sub(now, data->entry_stamp));
printk(KERN_INFO "%s returned %d and took %lld ns to execute\n",
pr_info("%s returned %d and took %lld ns to execute\n",
func_name, retval, (long long)delta);
return 0;
......@@ -82,11 +82,10 @@ static int __init kretprobe_init(void) = func_name;
ret = register_kretprobe(&my_kretprobe);
if (ret < 0) {
printk(KERN_INFO "register_kretprobe failed, returned %d\n",
pr_err("register_kretprobe failed, returned %d\n", ret);
return -1;
printk(KERN_INFO "Planted return probe at %s: %p\n",
pr_info("Planted return probe at %s: %p\n",,;
return 0;
......@@ -94,11 +93,10 @@ static int __init kretprobe_init(void)
static void __exit kretprobe_exit(void)
printk(KERN_INFO "kretprobe at %p unregistered\n",;
pr_info("kretprobe at %p unregistered\n",;
/* nmissed > 0 suggests that maxactive was set too low. */
printk(KERN_INFO "Missed probing %d instances of %s\n",
pr_info("Missed probing %d instances of %s\n",
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