函数逻辑报告 | 
Source Code:kernel\bpf\verifier.c | 
Create Date:2022-07-27 14:20:47 | 
| Last Modify:2022-05-19 20:02:10 | Copyright©Brick | 
| 首页 | 函数Tree | 
| 注解内核,赢得工具 | 下载SCCT | English | 
函数名称:check_attach_btf_id
函数原型:static int check_attach_btf_id(struct bpf_verifier_env *env)
返回类型:int
参数:
| 类型 | 参数 | 名称 | 
|---|---|---|
| struct bpf_verifier_env * | env | 
| 9519 | tgt_prog等于linked_prog | 
| 9521 | prefix[]等于"btf_trace_" | 
| 9525 | bool conservative = true | 
| 9531 | 如果 Type of BPF program 不等于BPF_PROG_TYPE_TRACING则返回:0 | 
| 9534 | 如果非btf_id则 | 
| 9538 | btf等于bpf_prog_get_target_btf(prog) | 
| 9539 | 如果非btf则 | 
| 9540 | verbose(env, "FENTRY/FEXIT program can only be attached to another program annotated with BTF\n") | 
| 9542 | 返回:负EINVAL | 
| 9544 | t等于btf_type_by_id(btf, btf_id) | 
| 9545 | 如果非t则 | 
| 9549 | tname等于btf_name_by_offset(btf, name_off) | 
| 9550 | 如果非tname则 | 
| 9554 | 如果tgt_prog则 | 
| 9555 | aux等于 Auxiliary fields | 
| 9557 | 以i小于func_info_cnt循环如果type_id恒等于btf_id则 | 
| 9562 | 如果subprog恒等于负1则 | 
| 9566 | conservative等于unreliable | 
| 9568 | 否则 | 
| 9573 | 当: For some prog types 恒等于BPF_TRACE_RAW_TP | 
| 9574 | 如果tgt_prog则 | 
| 9579 | 如果非btf_type_is_typedef(t)则 | 
| 9584 | 如果字符串指定长度比较则 | 
| 9590 | t等于btf_type_by_id(btf, type) | 
| 9591 | 如果非btf_type_is_ptr(t)则返回:负EINVAL | 
| 9594 | t等于btf_type_by_id(btf, type) | 
| 9595 | 如果非btf_type_is_func_proto(t)则返回:负EINVAL | 
| 9604 | true if attaching to BTF-enabled raw tp = true | 
| 9605 | 返回:0 | 
| 9606 | 当: For some prog types 恒等于BPF_TRACE_FENTRY | 
| 9607 | 当: For some prog types 恒等于BPF_TRACE_FEXIT | 
| 9608 | 如果非btf_type_is_func(t)则 | 
| 9613 | t等于btf_type_by_id(btf, type) | 
| 9614 | 如果非btf_type_is_func_proto(t)则返回:负EINVAL | 
| 9616 | tr等于bpf_trampoline_lookup(key) | 
| 9623 | 如果addr则 | 
| 9624 | trampoline等于tr | 
| 9625 | 转到:out | 
| 9627 | 如果tgt_prog且conservative则 | 
| 9628 | BTF_KIND_FUNC_PROTO for valid attach_btf_id = NULL | 
| 9629 | t = NULL | 
| 9635 | 如果tgt_prog则 | 
| 9636 | 如果非 Is our filter JIT'ed? 则 | 
| 9642 | 如果 Type of BPF program 恒等于BPF_PROG_TYPE_TRACING则 | 
| 9652 | 否则 | 
| 9654 | 如果非addr则 | 
| 9663 | trampoline等于tr | 
| 9664 | out : | 
| 9666 | 如果ret则bpf_trampoline_put(tr) | 
| 9668 | 返回:ret | 
| 9669 | 默认 | 
| 9670 | 返回:负EINVAL | 
| 名称 | 描述 | 
|---|---|
| bpf_check | 
| 源代码转换工具 开放的插件接口  | X | 
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码  |