函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:btf_add_type

函数原型:static int btf_add_type(struct btf_verifier_env *env, struct btf_type *t)

返回类型:int

参数:

类型参数名称
struct btf_verifier_env *env
struct btf_type *t
817  btf等于btf
823  如果types_sizenr_types小于2则
829  如果types_size恒等于Max # of type identifier
830  btf_verifier_log(env, "Exceeded max num of types")
831  返回:负E2BIG
834  expand_by等于max_t - return maximum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, types_size >> 2, 16)
835  new_size等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(u32, Max # of type identifier , types_size + expand_by)
838  new_types等于kvcalloc(new_size, new_types的长度, GFP_KERNEL | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.)
840  如果非new_types则返回:负ENOMEM
843  如果nr_types恒等于0则new_types[0]等于btf_void
845  否则内存复制(new_types, types, types的长度 * (nr_types + 1))
849  kvfree(types)
850  types等于new_types
851  types_size等于new_size
854  types[++(nr_types)]等于t
856  返回:0
调用者
名称描述
btf_check_all_metas