Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\trampoline.c Create Date:2022-07-28 13:15:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:bpf_trampoline_update

Proto:static int bpf_trampoline_update(struct bpf_trampoline *tr)

Type:int

Parameter:

TypeParameterName
struct bpf_trampoline *tr
124  old_image = Executable image of trampoline + ( selector + 1 & 1) * PAGE_SIZE / 2
125  new_image = Executable image of trampoline + (selector & 1) * PAGE_SIZE / 2
127  fentry_cnt = Number of attached programs. A counter per kind. [BPF_TRAMP_FENTRY]
128  fexit_cnt = Number of attached programs. A counter per kind. [BPF_TRAMP_FEXIT]
130  flags = Restore arguments before returning from trampoline to let original function* continue executing. This flag is used for fentry progs when there are no* fexit progs.
134  If fentry_cnt + fexit_cnt == 0 Then
135  err = unregister_fentry(tr, old_image)
136  selector = 0
137  Go to out
141  fentry = progs = progs_to_run
142  hlist_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the hlist_node within the struct.(aux, & list of BPF programs using this trampoline [BPF_TRAMP_FENTRY], tramp_hlist)
143  progs++ = prog
146  fexit = progs
147  hlist_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the hlist_node within the struct.(aux, & list of BPF programs using this trampoline [BPF_TRAMP_FEXIT], tramp_hlist)
148  progs++ = prog
150  If fexit_cnt Then flags = Call original function after fentry progs, but before fexit progs.* Makes sense for fentry/fexit, normal calls and indirect calls. | Skip current frame and return to parent. Makes sense for fentry/fexit* programs only. Should not be used with normal calls and indirect calls.
159  synchronize_rcu_tasks()
161  err = arch_prepare_bpf_trampoline(new_image, & model, flags, fentry, fentry_cnt, fexit, fexit_cnt, addr)
165  If err Then Go to out
168  If selector Then err = modify_fentry(tr, old_image, new_image)
171  Else err = st time registering
174  If err Then Go to out
176  selector++
177  out :
178  Return err
Caller
NameDescribe
bpf_trampoline_link_prog
bpf_trampoline_unlink_progpf_trampoline_unlink_prog() should never fail.