函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:bpf_trampoline_lookup

函数原型:struct bpf_trampoline *bpf_trampoline_lookup(u64 key)

返回类型:struct bpf_trampoline

参数:

类型参数名称
u64key
24  mutex_lock( & serializes access to trampoline_table )
25  head等于trampoline_table[hash_64(key, f_vmlinux has ~22k attachable functions. 1k htab is enough. )]
27  如果key恒等于key
28  _inc - increment a refcount*@r: the refcount to increment* Similar to atomic_inc(), but will saturate at REFCOUNT_SATURATED and WARN
29  转到:out
32  tr等于分配内存并置零
33  如果非tr则转到:out
37  image等于bpf_jit_alloc_exec(PAGE_SIZE)
38  如果非image
39  kfree(tr)
40  tr = NULL
41  转到:out
44  key等于key
45  INIT_HLIST_NODE( & hlist for trampoline_table )
46  hlist_add_head( & hlist for trampoline_table , head)
47  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
48  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & serializes access to fields of this trampoline )
49 i小于BPF_TRAMP_MAX循环INIT_HLIST_HEAD( & list of BPF programs using this trampoline [i])
52  set_vm_flush_reset_perms(image)
56  set_memory_x((long)image, 1)
57  Executable image of trampoline 等于image
58  out :
59  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
60  返回:tr
调用者
名称描述
check_attach_btf_id