Thread (18 messages) 18 messages, 5 authors, 2014-09-04
STALE4302d

[PATCH v5 2/3] kprobes: copy ainsn after alloc aggr kprobe

From: Wang Nan <hidden>
Date: 2014-08-27 13:15:47
Also in: lkml
Subsystem: kprobes, the rest · Maintainers: Naveen N Rao, "David S. Miller", Masami Hiramatsu, Linus Torvalds

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 <redacted>
Cc: Russell King <redacted>
Cc: "David A. Long" <redacted> 
Cc: Jon Medhurst <redacted>
Cc: Taras Kondratiuk <redacted>
Cc: Ben Dooks <redacted>
Cc: Ananth N Mavinakayanahalli <redacted>
Cc: Anil S Keshavamurthy <redacted>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Masami Hiramatsu <redacted>
Cc: Will Deacon <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help