Function report |
Source Code:kernel\bpf\btf.c |
Create Date:2022-07-28 13:21:05 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:btf_ctx_access
Proto:bool btf_ctx_access(int off, int size, enum bpf_access_type type, const struct bpf_prog *prog, struct bpf_insn_access_aux *info)
Type:bool
Parameter:
Type | Parameter | Name |
---|---|---|
int | off | |
int | size | |
enum bpf_access_type | type | |
const struct bpf_prog * | prog | |
struct bpf_insn_access_aux * | info |
3637 | tgt_prog = linked_prog |
3638 | btf = bpf_prog_get_target_btf(prog) |
3640 | log = r verbose logs |
3645 | If off % 8 Then |
3653 | nr_args = If t Then btf_type_vlen(t) Else 5 |
3654 | If true if attaching to BTF-enabled raw tp Then |
3660 | If For some prog types == BPF_TRACE_FEXIT && arg == nr_args Then |
3662 | If Not t Then Return true |
3666 | t = btf_type_by_id(btf, type) |
3671 | Else |
3672 | If Not t Then Return true |
3675 | t = btf_type_by_id(btf, type) |
3678 | When btf_type_is_modifier(t) cycle |
3679 | t = btf_type_by_id(btf, type) |
3680 | If btf_type_is_int(t) Then Return true |
3683 | If Not btf_type_is_ptr(t) Then |
3684 | bpf_log(log, "func '%s' arg%d '%s' has type %s. Only pointer access is allowed\n", tname, arg, __btf_name_by_offset(btf, name_off), btf_kind_str[BTF_INFO_KIND( "info" bits arrangement * bits 0-15: vlen (e.g. # of struct's members) * bits 16-23: unused * bits 24-27: kind (e.g. int, ptr, array...etc) * bits 28-30: unused * bit 31: kind_flag, currently used by * struct, union and fwd)]) |
3689 | Return false |
3691 | If type == 0 Then Return true |
3702 | If tgt_prog Then |
3703 | ret = btf_translate_to_vmlinux(log, btf, t, Type of BPF program ) |
3704 | If ret > 0 Then |
3707 | Else |
3708 | Return false |
3711 | t = btf_type_by_id(btf, type) |
3713 | When btf_type_is_modifier(t) cycle |
3714 | t = btf_type_by_id(btf, type) |
3715 | If Not is only a special case of struct:* all its offsetof(member) == 0 Then |
3719 | Return false |
3724 | Return true |
Name | Describe |
---|---|
tracing_prog_is_valid_access |
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 |