Lines Matching defs:opts
2772 const struct bpf_object_open_opts *opts)
2778 strict = !OPTS_GET(opts, relaxed_maps, false);
2779 pin_root_path = OPTS_GET(opts, pin_root_path, NULL);
5114 LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = BPF_F_MMAPABLE);
5117 fd = bpf_map_create(BPF_MAP_TYPE_ARRAY, "libbpf_mmap", sizeof(int), sizeof(int), 1, &opts);
5123 LIBBPF_OPTS(bpf_prog_load_opts, opts, .expected_attach_type = BPF_CGROUP_INET_SOCK_CREATE);
5135 fd = bpf_prog_load(BPF_PROG_TYPE_CGROUP_SOCK, NULL, "GPL", insns, insn_cnt, &opts);
7268 struct bpf_prog_load_opts *opts, long cookie)
7274 opts->expected_attach_type = 0;
7277 opts->prog_flags |= BPF_F_SLEEPABLE;
7280 opts->prog_flags |= BPF_F_XDP_HAS_FRAGS;
7317 * this callback is called after opts were populated by
7318 * libbpf, so this callback has to update opts explicitly here
7320 opts->attach_btf_obj_fd = btf_obj_fd;
7321 opts->attach_btf_id = btf_type_id;
7786 static int bpf_object_init_progs(struct bpf_object *obj, const struct bpf_object_open_opts *opts)
7820 const struct bpf_object_open_opts *opts)
7838 if (!OPTS_VALID(opts, bpf_object_open_opts))
7841 obj_name = OPTS_GET(opts, object_name, NULL);
7853 log_buf = OPTS_GET(opts, kernel_log_buf, NULL);
7854 log_size = OPTS_GET(opts, kernel_log_size, 0);
7855 log_level = OPTS_GET(opts, kernel_log_level, 0);
7869 btf_tmp_path = OPTS_GET(opts, btf_custom_path, NULL);
7882 kconfig = OPTS_GET(opts, kconfig, NULL);
7896 err = err ? : bpf_object__init_maps(obj, opts);
7897 err = err ? : bpf_object_init_progs(obj, opts);
7911 bpf_object__open_file(const char *path, const struct bpf_object_open_opts *opts)
7918 return libbpf_ptr(bpf_object_open(path, NULL, 0, opts));
7928 const struct bpf_object_open_opts *opts)
7933 return libbpf_ptr(bpf_object_open(NULL, obj_buf, obj_buf_sz, opts));
8949 int bpf_object__gen_loader(struct bpf_object *obj, struct gen_loader_opts *opts)
8953 if (!opts)
8955 if (!OPTS_VALID(opts, gen_loader_opts))
8960 gen->opts = opts;
9328 const struct libbpf_prog_handler_opts *opts)
9332 if (!OPTS_VALID(opts, libbpf_prog_handler_opts))
9359 sec_def->cookie = OPTS_GET(opts, cookie, 0);
9361 sec_def->prog_setup_fn = OPTS_GET(opts, prog_setup_fn, NULL);
9362 sec_def->prog_prepare_load_fn = OPTS_GET(opts, prog_prepare_load_fn, NULL);
9363 sec_def->prog_attach_fn = OPTS_GET(opts, prog_attach_fn, NULL);
10565 const struct bpf_perf_event_opts *opts)
10572 if (!OPTS_VALID(opts, bpf_perf_event_opts))
10594 force_ioctl_attach = OPTS_GET(opts, force_ioctl_attach, false);
10597 .perf_event.bpf_cookie = OPTS_GET(opts, bpf_cookie, 0));
10609 if (OPTS_GET(opts, bpf_cookie, 0)) {
10967 const struct bpf_kprobe_opts *opts)
10978 if (!OPTS_VALID(opts, bpf_kprobe_opts))
10981 attach_mode = OPTS_GET(opts, attach_mode, PROBE_ATTACH_MODE_DEFAULT);
10982 retprobe = OPTS_GET(opts, retprobe, false);
10983 offset = OPTS_GET(opts, offset, 0);
10984 pe_opts.bpf_cookie = OPTS_GET(opts, bpf_cookie, 0);
11064 DECLARE_LIBBPF_OPTS(bpf_kprobe_opts, opts,
11068 return bpf_program__attach_kprobe_opts(prog, func_name, &opts);
11073 const struct bpf_ksyscall_opts *opts)
11078 if (!OPTS_VALID(opts, bpf_ksyscall_opts))
11093 kprobe_opts.retprobe = OPTS_GET(opts, retprobe, false);
11094 kprobe_opts.bpf_cookie = OPTS_GET(opts, bpf_cookie, 0);
11288 const struct bpf_kprobe_multi_opts *opts)
11303 if (!OPTS_VALID(opts, bpf_kprobe_multi_opts))
11306 syms = OPTS_GET(opts, syms, false);
11307 addrs = OPTS_GET(opts, addrs, false);
11308 cnt = OPTS_GET(opts, cnt, false);
11309 cookies = OPTS_GET(opts, cookies, false);
11331 retprobe = OPTS_GET(opts, retprobe, false);
11366 DECLARE_LIBBPF_OPTS(bpf_kprobe_opts, opts);
11378 opts.retprobe = str_has_pfx(prog->sec_name, "kretprobe/");
11379 if (opts.retprobe)
11389 if (opts.retprobe && offset != 0) {
11395 opts.offset = offset;
11396 *link = bpf_program__attach_kprobe_opts(prog, func, &opts);
11403 LIBBPF_OPTS(bpf_ksyscall_opts, opts);
11412 opts.retprobe = str_has_pfx(prog->sec_name, "kretsyscall/");
11413 if (opts.retprobe)
11418 *link = bpf_program__attach_ksyscall(prog, syscall_name, &opts);
11424 LIBBPF_OPTS(bpf_kprobe_multi_opts, opts);
11436 opts.retprobe = str_has_pfx(prog->sec_name, "kretprobe.multi/");
11437 if (opts.retprobe)
11448 *link = bpf_program__attach_kprobe_multi_opts(prog, pattern, &opts);
11456 LIBBPF_OPTS(bpf_uprobe_multi_opts, opts);
11469 opts.retprobe = strcmp(probe_type, "uretprobe.multi") == 0;
11470 *link = bpf_program__attach_uprobe_multi(prog, -1, binary_path, func_name, &opts);
11723 const struct bpf_uprobe_multi_opts *opts)
11736 if (!OPTS_VALID(opts, bpf_uprobe_multi_opts))
11739 syms = OPTS_GET(opts, syms, NULL);
11740 offsets = OPTS_GET(opts, offsets, NULL);
11741 ref_ctr_offsets = OPTS_GET(opts, ref_ctr_offsets, NULL);
11742 cookies = OPTS_GET(opts, cookies, NULL);
11743 cnt = OPTS_GET(opts, cnt, 0);
11800 lopts.uprobe_multi.flags = OPTS_GET(opts, retprobe, false) ? BPF_F_UPROBE_MULTI_RETURN : 0;
11835 const struct bpf_uprobe_opts *opts)
11848 if (!OPTS_VALID(opts, bpf_uprobe_opts))
11851 attach_mode = OPTS_GET(opts, attach_mode, PROBE_ATTACH_MODE_DEFAULT);
11852 retprobe = OPTS_GET(opts, retprobe, false);
11853 ref_ctr_off = OPTS_GET(opts, ref_ctr_offset, 0);
11854 pe_opts.bpf_cookie = OPTS_GET(opts, bpf_cookie, 0);
11876 func_name = OPTS_GET(opts, func_name, NULL);
11980 DECLARE_LIBBPF_OPTS(bpf_uprobe_opts, opts);
12010 opts.retprobe = strcmp(probe_type, "uretprobe") == 0 ||
12012 if (opts.retprobe && offset != 0) {
12017 opts.func_name = func_name;
12018 *link = bpf_program__attach_uprobe_opts(prog, -1, binary_path, offset, &opts);
12038 DECLARE_LIBBPF_OPTS(bpf_uprobe_opts, opts, .retprobe = retprobe);
12040 return bpf_program__attach_uprobe_opts(prog, pid, binary_path, func_offset, &opts);
12047 const struct bpf_usdt_opts *opts)
12055 if (!OPTS_VALID(opts, bpf_uprobe_opts))
12088 usdt_cookie = OPTS_GET(opts, usdt_cookie, 0);
12183 const struct bpf_tracepoint_opts *opts)
12190 if (!OPTS_VALID(opts, bpf_tracepoint_opts))
12193 pe_opts.bpf_cookie = OPTS_GET(opts, bpf_cookie, 0);
12326 const struct bpf_trace_opts *opts)
12333 if (!OPTS_VALID(opts, bpf_trace_opts))
12348 link_opts.tracing.cookie = OPTS_GET(opts, cookie, 0);
12367 const struct bpf_trace_opts *opts)
12369 return bpf_program__attach_btf_id(prog, opts);
12392 const struct bpf_link_create_opts *opts)
12411 link_fd = bpf_link_create(prog_fd, target_fd, attach_type, opts);
12444 const struct bpf_tcx_opts *opts)
12450 if (!OPTS_VALID(opts, bpf_tcx_opts))
12453 relative_id = OPTS_GET(opts, relative_id, 0);
12454 relative_fd = OPTS_GET(opts, relative_fd, 0);
12468 link_create_opts.tcx.expected_revision = OPTS_GET(opts, expected_revision, 0);
12471 link_create_opts.flags = OPTS_GET(opts, flags, 0);
12479 const struct bpf_netkit_opts *opts)
12485 if (!OPTS_VALID(opts, bpf_netkit_opts))
12488 relative_id = OPTS_GET(opts, relative_id, 0);
12489 relative_fd = OPTS_GET(opts, relative_fd, 0);
12503 link_create_opts.netkit.expected_revision = OPTS_GET(opts, expected_revision, 0);
12506 link_create_opts.flags = OPTS_GET(opts, flags, 0);
12550 const struct bpf_iter_attach_opts *opts)
12558 if (!OPTS_VALID(opts, bpf_iter_attach_opts))
12561 link_create_opts.iter_info = OPTS_GET(opts, link_info, (void *)0);
12562 link_create_opts.iter_info_len = OPTS_GET(opts, link_info_len, 0);
12595 const struct bpf_netfilter_opts *opts)
12601 if (!OPTS_VALID(opts, bpf_netfilter_opts))
12616 lopts.netfilter.pf = OPTS_GET(opts, pf, 0);
12617 lopts.netfilter.hooknum = OPTS_GET(opts, hooknum, 0);
12618 lopts.netfilter.priority = OPTS_GET(opts, priority, 0);
12619 lopts.netfilter.flags = OPTS_GET(opts, flags, 0);
12947 const struct perf_buffer_opts *opts)
12954 if (!OPTS_VALID(opts, perf_buffer_opts))
12957 sample_period = OPTS_GET(opts, sample_period, 1);
12980 const struct perf_buffer_raw_opts *opts)
12987 if (!OPTS_VALID(opts, perf_buffer_raw_opts))
12993 p.cpu_cnt = OPTS_GET(opts, cpu_cnt, 0);
12994 p.cpus = OPTS_GET(opts, cpus, NULL);
12995 p.map_keys = OPTS_GET(opts, map_keys, NULL);
13510 const struct bpf_object_open_opts *opts)
13518 /* Attempt to preserve opts->object_name, unless overriden by user
13524 if (opts) {
13525 memcpy(&skel_opts, opts, sizeof(*opts));
13526 if (!opts->object_name)