Skip to content

Commit

Permalink
kprobes: update jprobe_example.c for do_fork() change
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mpe authored and Jiri Kosina committed Sep 26, 2014
1 parent 2d69049 commit e8ac6ea
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions samples/kprobes/jprobe_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,11 @@

/* Proxy routine having the same arguments as actual do_fork() routine */
static long jdo_fork(unsigned long clone_flags, unsigned long stack_start,
struct pt_regs *regs, unsigned long stack_size,
int __user *parent_tidptr, int __user *child_tidptr)
unsigned long stack_size, int __user *parent_tidptr,
int __user *child_tidptr)
{
printk(KERN_INFO "jprobe: clone_flags = 0x%lx, stack_size = 0x%lx,"
" regs = 0x%p\n",
clone_flags, stack_size, regs);
pr_info("jprobe: clone_flags = 0x%lx, stack_start = 0x%lx "
"stack_size = 0x%lx\n", clone_flags, stack_start, stack_size);

/* Always end with a call to jprobe_return(). */
jprobe_return();
Expand Down

0 comments on commit e8ac6ea

Please sign in to comment.