Function report |
Source Code:kernel\bpf\btf.c |
Create Date:2022-07-28 13:19:06 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:btf_struct_check_meta
Proto:static s32 btf_struct_check_meta(struct btf_verifier_env *env, const struct btf_type *t, u32 meta_left)
Type:s32
Parameter:
Type | Parameter | Name |
---|---|---|
struct btf_verifier_env * | env | |
const struct btf_type * | t | |
u32 | meta_left |
2138 | struct_size = size |
2142 | meta_needed = btf_type_vlen(t) * size of member |
2143 | If meta_left < meta_needed Then |
2144 | btf_verifier_log_basic(env, t, "meta_left:%u meta_needed:%u", meta_left, meta_needed) |
2147 | Return -EINVAL |
2151 | If name_off && Not Only C-style identifier is permitted. This can be relaxed if* necessary. Then |
2153 | btf_verifier_log_type(env, t, "Invalid name") |
2154 | Return -EINVAL |
2157 | btf_verifier_log_type(env, t, NULL) |
2159 | last_offset = 0 |
2161 | If Not btf_name_offset_valid(btf, name_off) Then |
2162 | btf_verifier_log_member(env, t, member, "Invalid member name_offset:%u", name_off) |
2165 | Return -EINVAL |
2169 | If name_off && Not Only C-style identifier is permitted. This can be relaxed if* necessary. Then |
2171 | btf_verifier_log_member(env, t, member, "Invalid name") |
2172 | Return -EINVAL |
2175 | If Not type || Not BTF_TYPE_ID_VALID(type) Then |
2176 | btf_verifier_log_member(env, t, member, "Invalid type_id") |
2178 | Return -EINVAL |
2181 | offset = btf_member_bit_offset(t, member) |
2183 | btf_verifier_log_member(env, t, member, "Invalid member bits_offset") |
2185 | Return -EINVAL |
2192 | If last_offset > offset Then |
2193 | btf_verifier_log_member(env, t, member, "Invalid member bits_offset") |
2195 | Return -EINVAL |
2198 | If BITS_ROUNDUP_BYTES(offset) > struct_size Then |
2199 | btf_verifier_log_member(env, t, member, "Member bits_offset exceeds its struct size") |
2201 | Return -EINVAL |
2204 | btf_verifier_log_member(env, t, member, NULL) |
2205 | last_offset = offset |
2208 | Return meta_needed |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |