Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\bpf\btf.c Create Date:2022-07-28 13:19:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:btf_enum_check_meta

Proto:static s32 btf_enum_check_meta(struct btf_verifier_env *env, const struct btf_type *t, u32 meta_left)

Type:s32

Parameter:

TypeParameterName
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_enums * size of enums
2442  If meta_left < meta_needed Then
2443  btf_verifier_log_basic(env, t, "meta_left:%u meta_needed:%u", meta_left, meta_needed)
2446  Return -EINVAL
2449  If btf_type_kflag(t) Then
2450  btf_verifier_log_type(env, t, "Invalid btf_info kind_flag")
2451  Return -EINVAL
2454  If size > 8 || Not 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. Then
2455  btf_verifier_log_type(env, t, "Unexpected size")
2456  Return -EINVAL
2460  If name_off && Not Only C-style identifier is permitted. This can be relaxed if* necessary. Then
2462  btf_verifier_log_type(env, t, "Invalid name")
2463  Return -EINVAL
2466  btf_verifier_log_type(env, t, NULL)
2468  When i < nr_enums cycle
2469  If Not btf_name_offset_valid(btf, name_off) Then
2470  btf_verifier_log(env, "\tInvalid name_offset:%u", name_off)
2472  Return -EINVAL
2478  btf_verifier_log_type(env, t, "Invalid name")
2479  Return -EINVAL
2482  If level == kernel internal flag Then Continue
2484  btf_verifier_log(env, "\t%s val=%d\n", __btf_name_by_offset(btf, name_off), val)
2489  Return meta_needed