From: wangnan0@huawei.com (Wang Nan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 2/3] kprobes: copy ainsn after alloc aggr kprobe
Date: Thu, 28 Aug 2014 19:07:25 +0800 [thread overview]
Message-ID: <53FF0D6D.9080302@huawei.com> (raw)
In-Reply-To: <53FEF8DC.5010607@hitachi.com>
On 2014/8/28 17:39, Masami Hiramatsu wrote:
> (2014/08/27 22:02), Wang Nan wrote:
>> Copy old kprobe to newly alloced optimized_kprobe before
>> arch_prepare_optimized_kprobe(). Original kprove can brings more
>> information to optimizer.
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: "David A. Long" <dave.long@linaro.org>
>> Cc: Jon Medhurst <tixy@linaro.org>
>> Cc: Taras Kondratiuk <taras.kondratiuk@linaro.org>
>> Cc: Ben Dooks <ben.dooks@codethink.co.uk>
>> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
>> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> ---
>> kernel/kprobes.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
>> index 3995f54..33cf568 100644
>> --- a/kernel/kprobes.c
>> +++ b/kernel/kprobes.c
>> @@ -730,7 +730,12 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p)
>> return NULL;
>>
>> INIT_LIST_HEAD(&op->list);
>> - op->kp.addr = p->addr;
>
> Do not remove this, since copy_kprobe() doesn't copy kp.addr.
>
> static inline void copy_kprobe(struct kprobe *ap, struct kprobe *p)
> {
> memcpy(&p->opcode, &ap->opcode, sizeof(kprobe_opcode_t));
> memcpy(&p->ainsn, &ap->ainsn, sizeof(struct arch_specific_insn));
> }
>
> Thank you,
>
It is my fault. I'll fix it in next version.
Thank you for your comment!
>> +
>> + /*
>> + * copy gives arch_prepare_optimized_kprobe
>> + * more information
>> + */
>> + copy_kprobe(p, &op->kp);
>> arch_prepare_optimized_kprobe(op);
>>
>> return &op->kp;
>>
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Wang Nan <wangnan0@huawei.com>
To: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Russell King <linux@arm.linux.org.uk>,
"David A. Long" <dave.long@linaro.org>,
Jon Medhurst <tixy@linaro.org>,
Taras Kondratiuk <taras.kondratiuk@linaro.org>,
Ben Dooks <ben.dooks@codethink.co.uk>,
"Ananth N Mavinakayanahalli" <ananth@in.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Will Deacon <will.deacon@arm.com>,
Pei Feiyue <peifeiyue@huawei.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 2/3] kprobes: copy ainsn after alloc aggr kprobe
Date: Thu, 28 Aug 2014 19:07:25 +0800 [thread overview]
Message-ID: <53FF0D6D.9080302@huawei.com> (raw)
In-Reply-To: <53FEF8DC.5010607@hitachi.com>
On 2014/8/28 17:39, Masami Hiramatsu wrote:
> (2014/08/27 22:02), Wang Nan wrote:
>> Copy old kprobe to newly alloced optimized_kprobe before
>> arch_prepare_optimized_kprobe(). Original kprove can brings more
>> information to optimizer.
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> Cc: Russell King <linux@arm.linux.org.uk>
>> Cc: "David A. Long" <dave.long@linaro.org>
>> Cc: Jon Medhurst <tixy@linaro.org>
>> Cc: Taras Kondratiuk <taras.kondratiuk@linaro.org>
>> Cc: Ben Dooks <ben.dooks@codethink.co.uk>
>> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
>> Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>
>> Cc: "David S. Miller" <davem@davemloft.net>
>> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
>> Cc: Will Deacon <will.deacon@arm.com>
>> ---
>> kernel/kprobes.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
>> index 3995f54..33cf568 100644
>> --- a/kernel/kprobes.c
>> +++ b/kernel/kprobes.c
>> @@ -730,7 +730,12 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p)
>> return NULL;
>>
>> INIT_LIST_HEAD(&op->list);
>> - op->kp.addr = p->addr;
>
> Do not remove this, since copy_kprobe() doesn't copy kp.addr.
>
> static inline void copy_kprobe(struct kprobe *ap, struct kprobe *p)
> {
> memcpy(&p->opcode, &ap->opcode, sizeof(kprobe_opcode_t));
> memcpy(&p->ainsn, &ap->ainsn, sizeof(struct arch_specific_insn));
> }
>
> Thank you,
>
It is my fault. I'll fix it in next version.
Thank you for your comment!
>> +
>> + /*
>> + * copy gives arch_prepare_optimized_kprobe
>> + * more information
>> + */
>> + copy_kprobe(p, &op->kp);
>> arch_prepare_optimized_kprobe(op);
>>
>> return &op->kp;
>>
>
>
next prev parent reply other threads:[~2014-08-28 11:07 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 13:02 [PATCH v5 0/3] kprobes: arm: enable OPTPROBES for ARM 32 Wang Nan
2014-08-27 13:02 ` Wang Nan
2014-08-27 13:02 ` [PATCH v5 1/3] ARM: probes: check stack operation when decoding Wang Nan
2014-08-27 13:02 ` Wang Nan
2014-08-28 9:51 ` Masami Hiramatsu
2014-08-28 9:51 ` Masami Hiramatsu
2014-08-28 10:20 ` Russell King - ARM Linux
2014-08-28 10:20 ` Russell King - ARM Linux
2014-08-28 10:24 ` Will Deacon
2014-08-28 10:24 ` Will Deacon
2014-08-29 8:47 ` Jon Medhurst (Tixy)
2014-08-29 8:47 ` Jon Medhurst (Tixy)
2014-08-30 1:28 ` Wang Nan
2014-08-30 1:28 ` Wang Nan
2014-09-01 17:29 ` Jon Medhurst (Tixy)
2014-09-01 17:29 ` Jon Medhurst (Tixy)
2014-08-27 13:02 ` [PATCH v5 2/3] kprobes: copy ainsn after alloc aggr kprobe Wang Nan
2014-08-27 13:02 ` Wang Nan
2014-08-28 9:39 ` Masami Hiramatsu
2014-08-28 9:39 ` Masami Hiramatsu
2014-08-28 11:07 ` Wang Nan [this message]
2014-08-28 11:07 ` Wang Nan
2014-08-27 13:02 ` [PATCH v5 3/3] kprobes: arm: enable OPTPROBES for ARM 32 Wang Nan
2014-08-27 13:02 ` Wang Nan
2014-08-28 10:20 ` Masami Hiramatsu
2014-08-28 10:20 ` Masami Hiramatsu
2014-09-02 13:49 ` Jon Medhurst (Tixy)
2014-09-02 13:49 ` Jon Medhurst (Tixy)
2014-09-03 10:18 ` Masami Hiramatsu
2014-09-03 10:18 ` Masami Hiramatsu
2014-09-03 10:30 ` Will Deacon
2014-09-03 10:30 ` Will Deacon
2014-09-04 10:40 ` Jon Medhurst (Tixy)
2014-09-04 10:40 ` Jon Medhurst (Tixy)
2014-09-04 10:52 ` Will Deacon
2014-09-04 10:52 ` Will Deacon
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=53FF0D6D.9080302@huawei.com \
--to=wangnan0@huawei.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.