Lines Matching refs:opts

173 		   const struct bpf_map_create_opts *opts)  in bpf_map_create()  argument
183 if (!OPTS_VALID(opts, bpf_map_create_opts)) in bpf_map_create()
193 attr.btf_fd = OPTS_GET(opts, btf_fd, 0); in bpf_map_create()
194 attr.btf_key_type_id = OPTS_GET(opts, btf_key_type_id, 0); in bpf_map_create()
195 attr.btf_value_type_id = OPTS_GET(opts, btf_value_type_id, 0); in bpf_map_create()
196 attr.btf_vmlinux_value_type_id = OPTS_GET(opts, btf_vmlinux_value_type_id, 0); in bpf_map_create()
197 attr.value_type_btf_obj_fd = OPTS_GET(opts, value_type_btf_obj_fd, 0); in bpf_map_create()
199 attr.inner_map_fd = OPTS_GET(opts, inner_map_fd, 0); in bpf_map_create()
200 attr.map_flags = OPTS_GET(opts, map_flags, 0); in bpf_map_create()
201 attr.map_extra = OPTS_GET(opts, map_extra, 0); in bpf_map_create()
202 attr.numa_node = OPTS_GET(opts, numa_node, 0); in bpf_map_create()
203 attr.map_ifindex = OPTS_GET(opts, map_ifindex, 0); in bpf_map_create()
205 attr.map_token_fd = OPTS_GET(opts, token_fd, 0); in bpf_map_create()
239 struct bpf_prog_load_opts *opts) in bpf_prog_load() argument
252 if (!OPTS_VALID(opts, bpf_prog_load_opts)) in bpf_prog_load()
255 attempts = OPTS_GET(opts, attempts, 0); in bpf_prog_load()
264 attr.expected_attach_type = OPTS_GET(opts, expected_attach_type, 0); in bpf_prog_load()
266 attr.prog_btf_fd = OPTS_GET(opts, prog_btf_fd, 0); in bpf_prog_load()
267 attr.prog_flags = OPTS_GET(opts, prog_flags, 0); in bpf_prog_load()
268 attr.prog_ifindex = OPTS_GET(opts, prog_ifindex, 0); in bpf_prog_load()
269 attr.kern_version = OPTS_GET(opts, kern_version, 0); in bpf_prog_load()
270 attr.prog_token_fd = OPTS_GET(opts, token_fd, 0); in bpf_prog_load()
282 attach_prog_fd = OPTS_GET(opts, attach_prog_fd, 0); in bpf_prog_load()
283 attach_btf_obj_fd = OPTS_GET(opts, attach_btf_obj_fd, 0); in bpf_prog_load()
288 attr.attach_btf_id = OPTS_GET(opts, attach_btf_id, 0); in bpf_prog_load()
294 log_buf = OPTS_GET(opts, log_buf, NULL); in bpf_prog_load()
295 log_size = OPTS_GET(opts, log_size, 0); in bpf_prog_load()
296 log_level = OPTS_GET(opts, log_level, 0); in bpf_prog_load()
301 func_info_rec_size = OPTS_GET(opts, func_info_rec_size, 0); in bpf_prog_load()
302 func_info = OPTS_GET(opts, func_info, NULL); in bpf_prog_load()
305 attr.func_info_cnt = OPTS_GET(opts, func_info_cnt, 0); in bpf_prog_load()
307 line_info_rec_size = OPTS_GET(opts, line_info_rec_size, 0); in bpf_prog_load()
308 line_info = OPTS_GET(opts, line_info, NULL); in bpf_prog_load()
311 attr.line_info_cnt = OPTS_GET(opts, line_info_cnt, 0); in bpf_prog_load()
313 attr.fd_array = ptr_to_u64(OPTS_GET(opts, fd_array, NULL)); in bpf_prog_load()
314 attr.fd_array_cnt = OPTS_GET(opts, fd_array_cnt, 0); in bpf_prog_load()
323 OPTS_SET(opts, log_true_size, attr.log_true_size); in bpf_prog_load()
364 OPTS_SET(opts, log_true_size, attr.log_true_size); in bpf_prog_load()
379 OPTS_SET(opts, log_true_size, attr.log_true_size); in bpf_prog_load()
527 const struct bpf_map_batch_opts *opts) in bpf_map_batch_common() argument
533 if (!OPTS_VALID(opts, bpf_map_batch_opts)) in bpf_map_batch_common()
543 attr.batch.elem_flags = OPTS_GET(opts, elem_flags, 0); in bpf_map_batch_common()
544 attr.batch.flags = OPTS_GET(opts, flags, 0); in bpf_map_batch_common()
553 const struct bpf_map_batch_opts *opts) in bpf_map_delete_batch() argument
556 NULL, (void *)keys, NULL, count, opts); in bpf_map_delete_batch()
561 const struct bpf_map_batch_opts *opts) in bpf_map_lookup_batch() argument
564 out_batch, keys, values, count, opts); in bpf_map_lookup_batch()
569 const struct bpf_map_batch_opts *opts) in bpf_map_lookup_and_delete_batch() argument
573 count, opts); in bpf_map_lookup_and_delete_batch()
577 const struct bpf_map_batch_opts *opts) in bpf_map_update_batch() argument
580 (void *)keys, (void *)values, count, opts); in bpf_map_update_batch()
583 int bpf_obj_pin_opts(int fd, const char *pathname, const struct bpf_obj_pin_opts *opts) in bpf_obj_pin_opts() argument
589 if (!OPTS_VALID(opts, bpf_obj_pin_opts)) in bpf_obj_pin_opts()
593 attr.path_fd = OPTS_GET(opts, path_fd, 0); in bpf_obj_pin_opts()
595 attr.file_flags = OPTS_GET(opts, file_flags, 0); in bpf_obj_pin_opts()
612 int bpf_obj_get_opts(const char *pathname, const struct bpf_obj_get_opts *opts) in bpf_obj_get_opts() argument
618 if (!OPTS_VALID(opts, bpf_obj_get_opts)) in bpf_obj_get_opts()
622 attr.path_fd = OPTS_GET(opts, path_fd, 0); in bpf_obj_get_opts()
624 attr.file_flags = OPTS_GET(opts, file_flags, 0); in bpf_obj_get_opts()
633 DECLARE_LIBBPF_OPTS(bpf_prog_attach_opts, opts, in bpf_prog_attach()
637 return bpf_prog_attach_opts(prog_fd, target_fd, type, &opts); in bpf_prog_attach()
641 const struct bpf_prog_attach_opts *opts) in bpf_prog_attach_opts() argument
648 if (!OPTS_VALID(opts, bpf_prog_attach_opts)) in bpf_prog_attach_opts()
651 relative_id = OPTS_GET(opts, relative_id, 0); in bpf_prog_attach_opts()
652 relative_fd = OPTS_GET(opts, relative_fd, 0); in bpf_prog_attach_opts()
653 flags = OPTS_GET(opts, flags, 0); in bpf_prog_attach_opts()
663 attr.replace_bpf_fd = OPTS_GET(opts, replace_fd, 0); in bpf_prog_attach_opts()
664 attr.expected_revision = OPTS_GET(opts, expected_revision, 0); in bpf_prog_attach_opts()
679 const struct bpf_prog_detach_opts *opts) in bpf_prog_detach_opts() argument
686 if (!OPTS_VALID(opts, bpf_prog_detach_opts)) in bpf_prog_detach_opts()
689 relative_id = OPTS_GET(opts, relative_id, 0); in bpf_prog_detach_opts()
690 relative_fd = OPTS_GET(opts, relative_fd, 0); in bpf_prog_detach_opts()
691 flags = OPTS_GET(opts, flags, 0); in bpf_prog_detach_opts()
701 attr.expected_revision = OPTS_GET(opts, expected_revision, 0); in bpf_prog_detach_opts()
727 const struct bpf_link_create_opts *opts) in bpf_link_create() argument
734 if (!OPTS_VALID(opts, bpf_link_create_opts)) in bpf_link_create()
737 iter_info_len = OPTS_GET(opts, iter_info_len, 0); in bpf_link_create()
738 target_btf_id = OPTS_GET(opts, target_btf_id, 0); in bpf_link_create()
744 if (!OPTS_ZEROED(opts, target_btf_id)) in bpf_link_create()
752 attr.link_create.flags = OPTS_GET(opts, flags, 0); in bpf_link_create()
761 attr.link_create.iter_info = ptr_to_u64(OPTS_GET(opts, iter_info, (void *)0)); in bpf_link_create()
765 attr.link_create.perf_event.bpf_cookie = OPTS_GET(opts, perf_event.bpf_cookie, 0); in bpf_link_create()
766 if (!OPTS_ZEROED(opts, perf_event)) in bpf_link_create()
771 attr.link_create.kprobe_multi.flags = OPTS_GET(opts, kprobe_multi.flags, 0); in bpf_link_create()
772 attr.link_create.kprobe_multi.cnt = OPTS_GET(opts, kprobe_multi.cnt, 0); in bpf_link_create()
773 attr.link_create.kprobe_multi.syms = ptr_to_u64(OPTS_GET(opts, kprobe_multi.syms, 0)); in bpf_link_create()
774 attr.link_create.kprobe_multi.addrs = ptr_to_u64(OPTS_GET(opts, kprobe_multi.addrs, 0)); in bpf_link_create()
775 attr.link_create.kprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, kprobe_multi.cookies, 0)); in bpf_link_create()
776 if (!OPTS_ZEROED(opts, kprobe_multi)) in bpf_link_create()
781 attr.link_create.uprobe_multi.flags = OPTS_GET(opts, uprobe_multi.flags, 0); in bpf_link_create()
782 attr.link_create.uprobe_multi.cnt = OPTS_GET(opts, uprobe_multi.cnt, 0); in bpf_link_create()
783 attr.link_create.uprobe_multi.path = ptr_to_u64(OPTS_GET(opts, uprobe_multi.path, 0)); in bpf_link_create()
784 attr.link_create.uprobe_multi.offsets = ptr_to_u64(OPTS_GET(opts, uprobe_multi.offsets, 0)); in bpf_link_create()
785 …attr.link_create.uprobe_multi.ref_ctr_offsets = ptr_to_u64(OPTS_GET(opts, uprobe_multi.ref_ctr_off… in bpf_link_create()
786 attr.link_create.uprobe_multi.cookies = ptr_to_u64(OPTS_GET(opts, uprobe_multi.cookies, 0)); in bpf_link_create()
787 attr.link_create.uprobe_multi.pid = OPTS_GET(opts, uprobe_multi.pid, 0); in bpf_link_create()
788 if (!OPTS_ZEROED(opts, uprobe_multi)) in bpf_link_create()
796 attr.link_create.tracing.cookie = OPTS_GET(opts, tracing.cookie, 0); in bpf_link_create()
797 if (!OPTS_ZEROED(opts, tracing)) in bpf_link_create()
801 attr.link_create.netfilter.pf = OPTS_GET(opts, netfilter.pf, 0); in bpf_link_create()
802 attr.link_create.netfilter.hooknum = OPTS_GET(opts, netfilter.hooknum, 0); in bpf_link_create()
803 attr.link_create.netfilter.priority = OPTS_GET(opts, netfilter.priority, 0); in bpf_link_create()
804 attr.link_create.netfilter.flags = OPTS_GET(opts, netfilter.flags, 0); in bpf_link_create()
805 if (!OPTS_ZEROED(opts, netfilter)) in bpf_link_create()
810 relative_fd = OPTS_GET(opts, tcx.relative_fd, 0); in bpf_link_create()
811 relative_id = OPTS_GET(opts, tcx.relative_id, 0); in bpf_link_create()
820 attr.link_create.tcx.expected_revision = OPTS_GET(opts, tcx.expected_revision, 0); in bpf_link_create()
821 if (!OPTS_ZEROED(opts, tcx)) in bpf_link_create()
826 relative_fd = OPTS_GET(opts, netkit.relative_fd, 0); in bpf_link_create()
827 relative_id = OPTS_GET(opts, netkit.relative_id, 0); in bpf_link_create()
836 attr.link_create.netkit.expected_revision = OPTS_GET(opts, netkit.expected_revision, 0); in bpf_link_create()
837 if (!OPTS_ZEROED(opts, netkit)) in bpf_link_create()
869 relative_fd = OPTS_GET(opts, cgroup.relative_fd, 0); in bpf_link_create()
870 relative_id = OPTS_GET(opts, cgroup.relative_id, 0); in bpf_link_create()
880 OPTS_GET(opts, cgroup.expected_revision, 0); in bpf_link_create()
881 if (!OPTS_ZEROED(opts, cgroup)) in bpf_link_create()
885 if (!OPTS_ZEROED(opts, flags)) in bpf_link_create()
905 if (!OPTS_ZEROED(opts, sz)) in bpf_link_create()
938 const struct bpf_link_update_opts *opts) in bpf_link_update() argument
944 if (!OPTS_VALID(opts, bpf_link_update_opts)) in bpf_link_update()
947 if (OPTS_GET(opts, old_prog_fd, 0) && OPTS_GET(opts, old_map_fd, 0)) in bpf_link_update()
953 attr.link_update.flags = OPTS_GET(opts, flags, 0); in bpf_link_update()
954 if (OPTS_GET(opts, old_prog_fd, 0)) in bpf_link_update()
955 attr.link_update.old_prog_fd = OPTS_GET(opts, old_prog_fd, 0); in bpf_link_update()
956 else if (OPTS_GET(opts, old_map_fd, 0)) in bpf_link_update()
957 attr.link_update.old_map_fd = OPTS_GET(opts, old_map_fd, 0); in bpf_link_update()
977 struct bpf_prog_query_opts *opts) in bpf_prog_query_opts() argument
983 if (!OPTS_VALID(opts, bpf_prog_query_opts)) in bpf_prog_query_opts()
989 attr.query.query_flags = OPTS_GET(opts, query_flags, 0); in bpf_prog_query_opts()
990 attr.query.count = OPTS_GET(opts, count, 0); in bpf_prog_query_opts()
991 attr.query.prog_ids = ptr_to_u64(OPTS_GET(opts, prog_ids, NULL)); in bpf_prog_query_opts()
992 attr.query.link_ids = ptr_to_u64(OPTS_GET(opts, link_ids, NULL)); in bpf_prog_query_opts()
993 attr.query.prog_attach_flags = ptr_to_u64(OPTS_GET(opts, prog_attach_flags, NULL)); in bpf_prog_query_opts()
994 attr.query.link_attach_flags = ptr_to_u64(OPTS_GET(opts, link_attach_flags, NULL)); in bpf_prog_query_opts()
998 OPTS_SET(opts, attach_flags, attr.query.attach_flags); in bpf_prog_query_opts()
999 OPTS_SET(opts, revision, attr.query.revision); in bpf_prog_query_opts()
1000 OPTS_SET(opts, count, attr.query.count); in bpf_prog_query_opts()
1008 LIBBPF_OPTS(bpf_prog_query_opts, opts); in bpf_prog_query()
1011 opts.query_flags = query_flags; in bpf_prog_query()
1012 opts.prog_ids = prog_ids; in bpf_prog_query()
1013 opts.prog_cnt = *prog_cnt; in bpf_prog_query()
1015 ret = bpf_prog_query_opts(target_fd, type, &opts); in bpf_prog_query()
1018 *attach_flags = opts.attach_flags; in bpf_prog_query()
1019 *prog_cnt = opts.prog_cnt; in bpf_prog_query()
1024 int bpf_prog_test_run_opts(int prog_fd, struct bpf_test_run_opts *opts) in bpf_prog_test_run_opts() argument
1030 if (!OPTS_VALID(opts, bpf_test_run_opts)) in bpf_prog_test_run_opts()
1035 attr.test.batch_size = OPTS_GET(opts, batch_size, 0); in bpf_prog_test_run_opts()
1036 attr.test.cpu = OPTS_GET(opts, cpu, 0); in bpf_prog_test_run_opts()
1037 attr.test.flags = OPTS_GET(opts, flags, 0); in bpf_prog_test_run_opts()
1038 attr.test.repeat = OPTS_GET(opts, repeat, 0); in bpf_prog_test_run_opts()
1039 attr.test.duration = OPTS_GET(opts, duration, 0); in bpf_prog_test_run_opts()
1040 attr.test.ctx_size_in = OPTS_GET(opts, ctx_size_in, 0); in bpf_prog_test_run_opts()
1041 attr.test.ctx_size_out = OPTS_GET(opts, ctx_size_out, 0); in bpf_prog_test_run_opts()
1042 attr.test.data_size_in = OPTS_GET(opts, data_size_in, 0); in bpf_prog_test_run_opts()
1043 attr.test.data_size_out = OPTS_GET(opts, data_size_out, 0); in bpf_prog_test_run_opts()
1044 attr.test.ctx_in = ptr_to_u64(OPTS_GET(opts, ctx_in, NULL)); in bpf_prog_test_run_opts()
1045 attr.test.ctx_out = ptr_to_u64(OPTS_GET(opts, ctx_out, NULL)); in bpf_prog_test_run_opts()
1046 attr.test.data_in = ptr_to_u64(OPTS_GET(opts, data_in, NULL)); in bpf_prog_test_run_opts()
1047 attr.test.data_out = ptr_to_u64(OPTS_GET(opts, data_out, NULL)); in bpf_prog_test_run_opts()
1051 OPTS_SET(opts, data_size_out, attr.test.data_size_out); in bpf_prog_test_run_opts()
1052 OPTS_SET(opts, ctx_size_out, attr.test.ctx_size_out); in bpf_prog_test_run_opts()
1053 OPTS_SET(opts, duration, attr.test.duration); in bpf_prog_test_run_opts()
1054 OPTS_SET(opts, retval, attr.test.retval); in bpf_prog_test_run_opts()
1096 const struct bpf_get_fd_by_id_opts *opts) in bpf_prog_get_fd_by_id_opts() argument
1102 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_prog_get_fd_by_id_opts()
1107 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_prog_get_fd_by_id_opts()
1119 const struct bpf_get_fd_by_id_opts *opts) in bpf_map_get_fd_by_id_opts() argument
1125 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_map_get_fd_by_id_opts()
1130 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_map_get_fd_by_id_opts()
1142 const struct bpf_get_fd_by_id_opts *opts) in bpf_btf_get_fd_by_id_opts() argument
1148 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_btf_get_fd_by_id_opts()
1153 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_btf_get_fd_by_id_opts()
1154 attr.fd_by_id_token_fd = OPTS_GET(opts, token_fd, 0); in bpf_btf_get_fd_by_id_opts()
1166 const struct bpf_get_fd_by_id_opts *opts) in bpf_link_get_fd_by_id_opts() argument
1172 if (!OPTS_VALID(opts, bpf_get_fd_by_id_opts)) in bpf_link_get_fd_by_id_opts()
1177 attr.open_flags = OPTS_GET(opts, open_flags, 0); in bpf_link_get_fd_by_id_opts()
1225 int bpf_raw_tracepoint_open_opts(int prog_fd, struct bpf_raw_tp_opts *opts) in bpf_raw_tracepoint_open_opts() argument
1231 if (!OPTS_VALID(opts, bpf_raw_tp_opts)) in bpf_raw_tracepoint_open_opts()
1236 attr.raw_tracepoint.name = ptr_to_u64(OPTS_GET(opts, tp_name, NULL)); in bpf_raw_tracepoint_open_opts()
1237 attr.raw_tracepoint.cookie = OPTS_GET(opts, cookie, 0); in bpf_raw_tracepoint_open_opts()
1245 LIBBPF_OPTS(bpf_raw_tp_opts, opts, .tp_name = name); in bpf_raw_tracepoint_open()
1247 return bpf_raw_tracepoint_open_opts(prog_fd, &opts); in bpf_raw_tracepoint_open()
1250 int bpf_btf_load(const void *btf_data, size_t btf_size, struct bpf_btf_load_opts *opts) in bpf_btf_load() argument
1263 if (!OPTS_VALID(opts, bpf_btf_load_opts)) in bpf_btf_load()
1266 log_buf = OPTS_GET(opts, log_buf, NULL); in bpf_btf_load()
1267 log_size = OPTS_GET(opts, log_size, 0); in bpf_btf_load()
1268 log_level = OPTS_GET(opts, log_level, 0); in bpf_btf_load()
1278 attr.btf_flags = OPTS_GET(opts, btf_flags, 0); in bpf_btf_load()
1279 attr.btf_token_fd = OPTS_GET(opts, token_fd, 0); in bpf_btf_load()
1300 OPTS_SET(opts, log_true_size, attr.btf_log_true_size); in bpf_btf_load()
1344 const struct bpf_prog_bind_opts *opts) in bpf_prog_bind_map() argument
1350 if (!OPTS_VALID(opts, bpf_prog_bind_opts)) in bpf_prog_bind_map()
1356 attr.prog_bind_map.flags = OPTS_GET(opts, flags, 0); in bpf_prog_bind_map()
1362 int bpf_token_create(int bpffs_fd, struct bpf_token_create_opts *opts) in bpf_token_create() argument
1368 if (!OPTS_VALID(opts, bpf_token_create_opts)) in bpf_token_create()
1373 attr.token_create.flags = OPTS_GET(opts, flags, 0); in bpf_token_create()
1380 struct bpf_prog_stream_read_opts *opts) in bpf_prog_stream_read() argument
1386 if (!OPTS_VALID(opts, bpf_prog_stream_read_opts)) in bpf_prog_stream_read()