函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:btf_get_prog_ctx_type

函数原型:static const struct btf_member *btf_get_prog_ctx_type(struct bpf_verifier_log *log, struct btf *btf, const struct btf_type *t, enum bpf_prog_type prog_type)

返回类型:struct btf_member

参数:

类型参数名称
struct bpf_verifier_log *log
struct btf *btf
const struct btf_type *t
enum bpf_prog_typeprog_type
3486  conv_struct等于 't' is written once under lock. Read many times.
3487  如果非conv_struct
3488  bpf_log(log, "btf_vmlinux is malformed\n")
3489  返回:NULL
3491  t等于btf_type_by_id(btf, type)
3492 btf_type_is_modifier(t)循环
3493  t等于btf_type_by_id(btf, type)
3494  如果非 is only a special case of struct:* all its offsetof(member) == 0
3500  bpf_log(log, "BPF program ctx type is not a struct\n")
3501  返回:NULL
3503  tname等于btf_name_by_offset(btf, name_off)
3504  如果非tname
3505  bpf_log(log, "BPF program ctx struct doesn't have a name\n")
3506  返回:NULL
3509  ctx_type等于btf_type_member(conv_struct)加bpf_ctx_convert_map[prog_type]乘2
3513  ctx_struct等于btf_type_by_id(btf_vmlinux, type)
3514  如果非ctx_struct则返回:NULL
3517  ctx_tname等于btf_name_by_offset(btf_vmlinux, name_off)
3518  如果非ctx_tname
3520  bpf_log(log, "Please fix kernel include/linux/bpf_types.h\n")
3521  返回:NULL
3530  如果字符串比较则返回:NULL
3532  返回:ctx_type
调用者
名称描述
btf_translate_to_vmlinux
btf_check_func_arg_match