Skip to content

Commit e8ac6ea

Browse files
mpeJiri Kosina
authored andcommitted
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 <[email protected]> Acked-by: Masami Hiramatsu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 2d69049 commit e8ac6ea

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

samples/kprobes/jprobe_example.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,11 @@
2424

2525
/* Proxy routine having the same arguments as actual do_fork() routine */
2626
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)
2929
{
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);
3332

3433
/* Always end with a call to jprobe_return(). */
3534
jprobe_return();

0 commit comments

Comments
 (0)