函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:btf_enum_check_meta

函数原型:static s32 btf_enum_check_meta(struct btf_verifier_env *env, const struct btf_type *t, u32 meta_left)

返回类型:s32

参数:

类型参数名称
struct btf_verifier_env *env
const struct btf_type *t
u32meta_left
2434  enums等于btf_type_enum(t)
2435  btf等于btf
2439  nr_enums等于btf_type_vlen(t)
2440  meta_needed等于nr_enumsenums的长度
2442  如果meta_left小于meta_needed
2443  btf_verifier_log_basic(env, t, "meta_left:%u meta_needed:%u", meta_left, meta_needed)
2446  返回:负EINVAL
2449  如果btf_type_kflag(t)则
2450  btf_verifier_log_type(env, t, "Invalid btf_info kind_flag")
2451  返回:负EINVAL
2454  如果size大于8或非s_power_of_2() - check if a value is a power of two*@n: the value to check* Determine whether some value is a power of two, where zero is* *not* considered a power of two.* Return: true if @n is a power of 2, otherwise false.
2455  btf_verifier_log_type(env, t, "Unexpected size")
2456  返回:负EINVAL
2460  如果name_off且非Only C-style identifier is permitted. This can be relaxed if* necessary.
2462  btf_verifier_log_type(env, t, "Invalid name")
2463  返回:负EINVAL
2466  btf_verifier_log_type(env, t, NULL)
2468 i小于nr_enums循环
2469  如果非btf_name_offset_valid(btf, name_off)则
2470  btf_verifier_log(env, "\tInvalid name_offset:%u", name_off)
2472  返回:负EINVAL
2478  btf_verifier_log_type(env, t, "Invalid name")
2479  返回:负EINVAL
2482  如果level恒等于kernel internal flag 则继续下一循环
2484  btf_verifier_log(env, "\t%s val=%d\n", __btf_name_by_offset(btf, name_off), val)
2489  返回:meta_needed