函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Resolve the size of a passed-in "type"* return type: type "u32[x][y]", i.e. BTF_KIND_ARRAY,* *type_size: (x * y * sizeof(u32)). Hence, *type_size always* corresponds to the return type.* *elem_type: u32* *total_nelems: (x * y)

函数原型:static const struct btf_type *btf_resolve_size(const struct btf *btf, const struct btf_type *type, u32 *type_size, const struct btf_type **elem_type, u32 *total_nelems)

返回类型:struct btf_type

参数:

类型参数名称
const struct btf *btf
const struct btf_type *type is an array (e.g. u32 array[x][y])
u32 *type_size
const struct btf_type **elem_type
u32 *total_nelems
1065  const struct btf_type * array_type = NULL
1067  nelems等于1
1069 i小于MAX_RESOLVE_DEPTH循环
1072  :BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)恒等于Integer
1073  :BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)恒等于Struct
1074  :BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)恒等于Union
1076  size等于size
1077  转到:resolved
1080  size等于*的长度
1081  转到:resolved
1084  :BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)恒等于Typedef
1085  :BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)恒等于Volatile
1086  :BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)恒等于Const
1089  退出
1095  如果nelemsnelems大于U32_MAXnelems则返回:错误号
1097  nelems乘等于nelems
1099  退出
1102  默认
1103  返回:错误号
1107  返回:错误号
1109  resolved :
1110  如果nelemssize大于U32_MAXnelems则返回:错误号
1113  type_size等于nelemssize
1114  total_nelems等于nelems
1115  elem_type等于 is an array (e.g. u32 array[x][y])
1117  返回:如果array_type否则 is an array (e.g. u32 array[x][y])
调用者
名称描述
btf_struct_access