函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\trampoline.c Create Date:2022-07-27 14:32:55
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:bpf_trampoline_update

函数原型:static int bpf_trampoline_update(struct bpf_trampoline *tr)

返回类型:int

参数:

类型参数名称
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  如果fentry_cntfexit_cnt恒等于0则
135  err等于unregister_fentry(tr, old_image)
136  selector等于0
137  转到: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  如果fexit_cntflags等于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  如果err则转到:out
168  如果selectorerr等于modify_fentry(tr, old_image, new_image)
171  否则err等于st time registering
174  如果err则转到:out
176  selector自加
177  out :
178  返回:err
调用者
名称描述
bpf_trampoline_link_prog
bpf_trampoline_unlink_progpf_trampoline_unlink_prog() should never fail.