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 <[email protected]>
Cc: Russell King <[email protected]>
Cc: "David A. Long" <[email protected]> 
Cc: Jon Medhurst <[email protected]>
Cc: Taras Kondratiuk <[email protected]>
Cc: Ben Dooks <[email protected]>
Cc: Ananth N Mavinakayanahalli <[email protected]>
Cc: Anil S Keshavamurthy <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Cc: Will Deacon <[email protected]>
---
 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;
+
+       /*
+        * copy gives arch_prepare_optimized_kprobe
+        * more information
+        */
+       copy_kprobe(p, &op->kp);
        arch_prepare_optimized_kprobe(op);
 
        return &op->kp;
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to