mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
bpf: Drop unnecessary ftrace_location() in register/unregister/modify_fentry_multi()
Since 'tr->ip' is already a 'ftrace_location()'-ed IP in bpf_trampoline_lookup(), it is unnecessary to call ftrace_location() again in register/unregister/modify_fentry_multi(). No functional changes intended. Signed-off-by: Leon Hwang <leon.hwang@linux.dev> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: https://patch.msgid.link/20261016142014.12420-3-leon.hwang@linux.dev
This commit is contained in:
parent
09ec92d707
commit
b443a4578a
|
|
@ -1629,8 +1629,8 @@ static void ftrace_hash_add(struct ftrace_hash *hash, struct ftrace_func_entry *
|
|||
static int register_fentry_multi(struct bpf_trampoline *tr, struct bpf_tramp_image *im, void *ptr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) im->image;
|
||||
unsigned long ip = ftrace_location(tr->ip);
|
||||
struct bpf_tracing_multi_data *data = ptr;
|
||||
unsigned long ip = tr->ip;
|
||||
|
||||
/*
|
||||
* Different BTF ids get different trampolines, but they can still
|
||||
|
|
@ -1651,13 +1651,12 @@ static int register_fentry_multi(struct bpf_trampoline *tr, struct bpf_tramp_ima
|
|||
static int unregister_fentry_multi(struct bpf_trampoline *tr, u32 orig_flags, void *ptr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) tr->cur_image->image;
|
||||
unsigned long ip = ftrace_location(tr->ip);
|
||||
struct bpf_tracing_multi_data *data = ptr;
|
||||
|
||||
if (bpf_trampoline_use_jmp(tr->flags))
|
||||
addr = ftrace_jmp_set(addr);
|
||||
|
||||
ftrace_hash_add(data->unreg, data->entry, ip, addr);
|
||||
ftrace_hash_add(data->unreg, data->entry, tr->ip, addr);
|
||||
tr->cur_image = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1666,13 +1665,12 @@ static int modify_fentry_multi(struct bpf_trampoline *tr, u32 orig_flags, struct
|
|||
bool lock_direct_mutex, void *ptr)
|
||||
{
|
||||
unsigned long addr = (unsigned long) im->image;
|
||||
unsigned long ip = ftrace_location(tr->ip);
|
||||
struct bpf_tracing_multi_data *data = ptr;
|
||||
|
||||
if (bpf_trampoline_use_jmp(tr->flags))
|
||||
addr = ftrace_jmp_set(addr);
|
||||
|
||||
ftrace_hash_add(data->modify, data->entry, ip, addr);
|
||||
ftrace_hash_add(data->modify, data->entry, tr->ip, addr);
|
||||
tr->cur_image = im;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user