From: masami.hiramatsu.pt@hitachi.com (Masami Hiramatsu)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 1/2] kprobes: copy ainsn after alloc aggr kprobe
Date: Mon, 27 Oct 2014 21:24:57 +0900 [thread overview]
Message-ID: <544E3999.2010802@hitachi.com> (raw)
In-Reply-To: <1414219865-35988-2-git-send-email-wangnan0@huawei.com>
(2014/10/25 15:51), Wang Nan wrote:
> Copy old kprobe to newly alloced optimized_kprobe before
> arch_prepare_optimized_kprobe(). Original kprove can brings more
> information to optimizer.
Hmm, yes, but this also call copy_kprobe twice in try_to_optimize_kprobe().
If you really need the original kprobe information, I think you'd better
change the arch_prepare_optimized_kprobe as below;
/* Pass both of new optprobe and original kprobe */
arch_prepare_optimized_kprobe(op, p);
Thank you,
>
> v1 -> v2:
> - Bugfix: copy p->addr when alloc_aggr_kprobe.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> ---
> kernel/kprobes.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 3995f54..e9868ec 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -730,7 +730,13 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p)
> return NULL;
>
> INIT_LIST_HEAD(&op->list);
> +
> + /*
> + * copy gives arch_prepare_optimized_kprobe
> + * more information
> + */
> op->kp.addr = p->addr;
> + copy_kprobe(p, &op->kp);
> arch_prepare_optimized_kprobe(op);
>
> return &op->kp;
>
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt at hitachi.com
WARNING: multiple messages have this Message-ID (diff)
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: Wang Nan <wangnan0@huawei.com>
Cc: tixy@linaro.org, linux@arm.linux.org.uk, will.deacon@arm.com,
dave.long@linaro.org, taras.kondratiuk@linaro.org,
ben.dooks@codethink.co.uk, cl@linux.com, rabin@rab.in,
davem@davemloft.net, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, lizefan@huawei.com
Subject: Re: [PATCH v7 1/2] kprobes: copy ainsn after alloc aggr kprobe
Date: Mon, 27 Oct 2014 21:24:57 +0900 [thread overview]
Message-ID: <544E3999.2010802@hitachi.com> (raw)
In-Reply-To: <1414219865-35988-2-git-send-email-wangnan0@huawei.com>
(2014/10/25 15:51), Wang Nan wrote:
> Copy old kprobe to newly alloced optimized_kprobe before
> arch_prepare_optimized_kprobe(). Original kprove can brings more
> information to optimizer.
Hmm, yes, but this also call copy_kprobe twice in try_to_optimize_kprobe().
If you really need the original kprobe information, I think you'd better
change the arch_prepare_optimized_kprobe as below;
/* Pass both of new optprobe and original kprobe */
arch_prepare_optimized_kprobe(op, p);
Thank you,
>
> v1 -> v2:
> - Bugfix: copy p->addr when alloc_aggr_kprobe.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> ---
> kernel/kprobes.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index 3995f54..e9868ec 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -730,7 +730,13 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p)
> return NULL;
>
> INIT_LIST_HEAD(&op->list);
> +
> + /*
> + * copy gives arch_prepare_optimized_kprobe
> + * more information
> + */
> op->kp.addr = p->addr;
> + copy_kprobe(p, &op->kp);
> arch_prepare_optimized_kprobe(op);
>
> return &op->kp;
>
--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com
next prev parent reply other threads:[~2014-10-27 12:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-25 6:51 [PATCH v7 0/2] ARM: kprobes: enable OPTPROBES for ARM 32 Wang Nan
2014-10-25 6:51 ` Wang Nan
2014-10-25 6:51 ` [PATCH v7 1/2] kprobes: copy ainsn after alloc aggr kprobe Wang Nan
2014-10-25 6:51 ` Wang Nan
2014-10-27 12:24 ` Masami Hiramatsu [this message]
2014-10-27 12:24 ` Masami Hiramatsu
2014-10-25 6:51 ` [PATCH v7 2/2] ARM: kprobes: enable OPTPROBES for ARM 32 Wang Nan
2014-10-25 6:51 ` Wang Nan
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=544E3999.2010802@hitachi.com \
--to=masami.hiramatsu.pt@hitachi.com \
--cc=linux-arm-kernel@lists.infradead.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.