From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: trivial@kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] samples/kprobes: Update jprobe_example.c for do_fork() change
Date: Mon, 23 Jun 2014 17:46:02 +0900 [thread overview]
Message-ID: <53A7E94A.3080601@hitachi.com> (raw)
In-Reply-To: <1403493027-16638-1-git-send-email-mpe@ellerman.id.au>
(2014/06/23 12:10), Michael Ellerman wrote:
> 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>
Thanks!
> ---
> samples/kprobes/jprobe_example.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/samples/kprobes/jprobe_example.c b/samples/kprobes/jprobe_example.c
> index b754135..9119ac6 100644
> --- a/samples/kprobes/jprobe_example.c
> +++ b/samples/kprobes/jprobe_example.c
> @@ -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();
>
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
prev parent reply other threads:[~2014-06-23 8:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-23 3:10 [PATCH] samples/kprobes: Update jprobe_example.c for do_fork() change Michael Ellerman
2014-06-23 8:46 ` Masami Hiramatsu [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53A7E94A.3080601@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpe@ellerman.id.au \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.