提交 a460246c 编写于 作者: M Masami Hiramatsu 提交者: Michael Ellerman

kprobes: Skip preparing optprobe if the probe is ftrace-based

Skip preparing optprobe if the probe is ftrace-based, since anyway, it
must not be optimized (or already optimized by ftrace).
Tested-by: NNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: NMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
上级 97da3854
...@@ -746,13 +746,20 @@ static void kill_optimized_kprobe(struct kprobe *p) ...@@ -746,13 +746,20 @@ static void kill_optimized_kprobe(struct kprobe *p)
arch_remove_optimized_kprobe(op); 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 */ /* Try to prepare optimized instructions */
static void prepare_optimized_kprobe(struct kprobe *p) static void prepare_optimized_kprobe(struct kprobe *p)
{ {
struct optimized_kprobe *op; struct optimized_kprobe *op;
op = container_of(p, struct optimized_kprobe, kp); 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 */ /* Allocate new optimized_kprobe and try to prepare optimized instructions */
...@@ -766,7 +773,7 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p) ...@@ -766,7 +773,7 @@ static struct kprobe *alloc_aggr_kprobe(struct kprobe *p)
INIT_LIST_HEAD(&op->list); INIT_LIST_HEAD(&op->list);
op->kp.addr = p->addr; op->kp.addr = p->addr;
arch_prepare_optimized_kprobe(op, p); __prepare_optimized_kprobe(op, p);
return &op->kp; return &op->kp;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册