kprobes: Pass the original kprobe for preparing optimized kprobe
Pass the original kprobe for preparing an optimized kprobe arch-dep part, since for some architecture (e.g. ARM32) requires the information in original kprobe. Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Signed-off-by: Wang Nan <wangnan0@huawei.com> Signed-off-by: Jon Medhurst <tixy@linaro.org>
This commit is contained in:
parent
8d257e95a9
commit
cbf6ab52ad
|
@ -322,7 +322,8 @@ void arch_remove_optimized_kprobe(struct optimized_kprobe *op)
|
||||||
* Target instructions MUST be relocatable (checked inside)
|
* Target instructions MUST be relocatable (checked inside)
|
||||||
* This is called when new aggr(opt)probe is allocated or reused.
|
* This is called when new aggr(opt)probe is allocated or reused.
|
||||||
*/
|
*/
|
||||||
int arch_prepare_optimized_kprobe(struct optimized_kprobe *op)
|
int arch_prepare_optimized_kprobe(struct optimized_kprobe *op,
|
||||||
|
struct kprobe *__unused)
|
||||||
{
|
{
|
||||||
u8 *buf;
|
u8 *buf;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
@ -308,7 +308,8 @@ struct optimized_kprobe {
|
||||||
/* Architecture dependent functions for direct jump optimization */
|
/* Architecture dependent functions for direct jump optimization */
|
||||||
extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn);
|
extern int arch_prepared_optinsn(struct arch_optimized_insn *optinsn);
|
||||||
extern int arch_check_optimized_kprobe(struct optimized_kprobe *op);
|
extern int arch_check_optimized_kprobe(struct optimized_kprobe *op);
|
||||||
extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op);
|
extern int arch_prepare_optimized_kprobe(struct optimized_kprobe *op,
|
||||||
|
struct kprobe *orig);
|
||||||
extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op);
|
extern void arch_remove_optimized_kprobe(struct optimized_kprobe *op);
|
||||||
extern void arch_optimize_kprobes(struct list_head *oplist);
|
extern void arch_optimize_kprobes(struct list_head *oplist);
|
||||||
extern void arch_unoptimize_kprobes(struct list_head *oplist,
|
extern void arch_unoptimize_kprobes(struct list_head *oplist,
|
||||||
|
|
|
@ -717,7 +717,7 @@ 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);
|
arch_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 */
|
||||||
|
@ -731,7 +731,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);
|
arch_prepare_optimized_kprobe(op, p);
|
||||||
|
|
||||||
return &op->kp;
|
return &op->kp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user