Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1626078 > unrolled thread

[PATCH v4 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based

Started by"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
First post2017-04-19 15:00 +0200
Last post2017-04-25 00:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> - 2017-04-19 15:00 +0200
    Re: [v4, 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based Michael Ellerman <patch-notifications@ellerman.id.au> - 2017-04-25 00:50 +0200

#1626078 — [PATCH v4 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based

From"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Date2017-04-19 15:00 +0200
Subject[PATCH v4 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based
Message-ID<txXnc-3yQ-29@gated-at.bofh.it>
From: Masami Hiramatsu <mhiramat@kernel.org>

Skip preparing optprobe if the probe is ftrace-based, since anyway, it
must not be optimized (or already optimized by ftrace).

Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 kernel/kprobes.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index bb86681c8a10..50c48c5b6490 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -743,13 +743,20 @@ static void kill_optimized_kprobe(struct kprobe *p)
 	arch_remove_optimized_kprobe(op);
 }
 
+static inline
+void __prepare_optimized_kprobe(struct optimized_kprobe *op, struct kprobe *p)
+{
+	if (!kprobe_ftrace(p))
+		arch_prepare_optimized_kprobe(op, p);
+}
+
 /* Try to prepare optimized instructions */
 static void prepare_optimized_kprobe(struct kprobe *p)
 {
 	struct optimized_kprobe *op;
 
 	op = container_of(p, struct optimized_kprobe, kp);
-	arch_prepare_optimized_kprobe(op, p);
+	__prepare_optimized_kprobe(op, p);
 }
 
 /* Allocate new optimized_kprobe and try to prepare optimized instructions */
@@ -763,7 +770,7 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p)
 
 	INIT_LIST_HEAD(&op->list);
 	op->kp.addr = p->addr;
-	arch_prepare_optimized_kprobe(op, p);
+	__prepare_optimized_kprobe(op, p);
 
 	return &op->kp;
 }
-- 
2.12.1

[toc] | [next] | [standalone]


#1630090 — Re: [v4, 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based

FromMichael Ellerman <patch-notifications@ellerman.id.au>
Date2017-04-25 00:50 +0200
SubjectRe: [v4, 3/6] kprobes: Skip preparing optprobe if the probe is ftrace-based
Message-ID<tzUXT-4w3-1@gated-at.bofh.it>
In reply to#1626078
On Wed, 2017-04-19 at 12:52:25 UTC, "Naveen N. Rao" wrote:
> From: Masami Hiramatsu <mhiramat@kernel.org>
> 
> Skip preparing optprobe if the probe is ftrace-based, since anyway, it
> must not be optimized (or already optimized by ftrace).
> 
> Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a460246c70d1ac25a0717112e7a167

cheers

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web