Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kprobes: update jprobe_example.c for do_fork() change

In commit e80d666 "flagday: kill pt_regs argument of do_fork()", the
arguments to do_fork() changed.

The example code in jprobe_example.c was not updated to match, so the
arguments inside the jprobe handler do not match reality.

Fix it by updating the arguments to match do_fork(). While we're at it
use pr_info() for brevity, and print stack_start as well for interest.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Michael Ellerman and committed by
Jiri Kosina
e8ac6ea8 2d69049a

+4 -5
+4 -5
samples/kprobes/jprobe_example.c
··· 24 24 25 25 /* Proxy routine having the same arguments as actual do_fork() routine */ 26 26 static long jdo_fork(unsigned long clone_flags, unsigned long stack_start, 27 - struct pt_regs *regs, unsigned long stack_size, 28 - int __user *parent_tidptr, int __user *child_tidptr) 27 + unsigned long stack_size, int __user *parent_tidptr, 28 + int __user *child_tidptr) 29 29 { 30 - printk(KERN_INFO "jprobe: clone_flags = 0x%lx, stack_size = 0x%lx," 31 - " regs = 0x%p\n", 32 - clone_flags, stack_size, regs); 30 + pr_info("jprobe: clone_flags = 0x%lx, stack_start = 0x%lx " 31 + "stack_size = 0x%lx\n", clone_flags, stack_start, stack_size); 33 32 34 33 /* Always end with a call to jprobe_return(). */ 35 34 jprobe_return();