Lines Matching refs:sec_def
252 const struct bpf_sec_def *sec_def; member
6657 if (prog->sec_def && prog->sec_def->preload_fn) { in bpf_object_load_prog_instance()
6658 err = prog->sec_def->preload_fn(prog, &load_attr, prog->sec_def->cookie); in bpf_object_load_prog_instance()
6937 prog->sec_def = find_sec_def(prog->sec_name); in bpf_object_init_progs()
6938 if (!prog->sec_def) { in bpf_object_init_progs()
6945 bpf_program__set_type(prog, prog->sec_def->prog_type); in bpf_object_init_progs()
6946 bpf_program__set_expected_attach_type(prog, prog->sec_def->expected_attach_type); in bpf_object_init_progs()
6950 if (prog->sec_def->prog_type == BPF_PROG_TYPE_TRACING || in bpf_object_init_progs()
6951 prog->sec_def->prog_type == BPF_PROG_TYPE_EXT) in bpf_object_init_progs()
6958 if (prog->sec_def->init_fn) { in bpf_object_init_progs()
6959 err = prog->sec_def->init_fn(prog, prog->sec_def->cookie); in bpf_object_init_progs()
8673 const struct bpf_sec_def *sec_def; in find_sec_def() local
8679 sec_def = §ion_defs[i]; in find_sec_def()
8680 sec_flags = sec_def->cookie; in find_sec_def()
8681 len = strlen(sec_def->sec); in find_sec_def()
8684 if (sec_def->sec[len - 1] == '/') { in find_sec_def()
8685 if (str_has_pfx(sec_name, sec_def->sec)) in find_sec_def()
8686 return sec_def; in find_sec_def()
8693 if (sec_def->sec[len - 1] == '+') { in find_sec_def()
8696 if (strncmp(sec_name, sec_def->sec, len) != 0) in find_sec_def()
8700 return sec_def; in find_sec_def()
8710 if (str_has_pfx(sec_name, sec_def->sec)) in find_sec_def()
8711 return sec_def; in find_sec_def()
8718 if (strcmp(sec_name, sec_def->sec) == 0) in find_sec_def()
8719 return sec_def; in find_sec_def()
8736 const struct bpf_sec_def *sec_def = §ion_defs[i]; in libbpf_get_type_names() local
8739 if (sec_def->preload_fn != libbpf_preload_prog) in libbpf_get_type_names()
8742 if (!(sec_def->cookie & SEC_ATTACHABLE)) in libbpf_get_type_names()
8760 const struct bpf_sec_def *sec_def; in libbpf_prog_type_by_name() local
8766 sec_def = find_sec_def(name); in libbpf_prog_type_by_name()
8767 if (sec_def) { in libbpf_prog_type_by_name()
8768 *prog_type = sec_def->prog_type; in libbpf_prog_type_by_name()
8769 *expected_attach_type = sec_def->expected_attach_type; in libbpf_prog_type_by_name()
9105 const struct bpf_sec_def *sec_def; in libbpf_attach_type_by_name() local
9110 sec_def = find_sec_def(name); in libbpf_attach_type_by_name()
9111 if (!sec_def) { in libbpf_attach_type_by_name()
9122 if (sec_def->preload_fn != libbpf_preload_prog) in libbpf_attach_type_by_name()
9124 if (!(sec_def->cookie & SEC_ATTACHABLE)) in libbpf_attach_type_by_name()
9127 *attach_type = sec_def->expected_attach_type; in libbpf_attach_type_by_name()
10648 if (!prog->sec_def || !prog->sec_def->attach_fn) in bpf_program__attach()
10651 return prog->sec_def->attach_fn(prog, prog->sec_def->cookie); in bpf_program__attach()
11792 if (!prog->sec_def || !prog->sec_def->attach_fn) in bpf_object__attach_skeleton()