/tools/testing/selftests/bpf/prog_tests/ |
D | xdp_info.c | 9 __u32 len = sizeof(struct bpf_prog_info), duration = 0, prog_id; in test_xdp_info() local 17 err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, 0); in test_xdp_info() 20 if (CHECK(prog_id, "prog_id_none", "unexpected prog_id=%u\n", prog_id)) in test_xdp_info() 23 err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_SKB_MODE); in test_xdp_info() 26 if (CHECK(prog_id, "prog_id_none_skb", "unexpected prog_id=%u\n", in test_xdp_info() 27 prog_id)) in test_xdp_info() 46 err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, 0); in test_xdp_info() 49 if (CHECK(prog_id != info.id, "prog_id", "prog_id not available\n")) in test_xdp_info() 52 err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_SKB_MODE); in test_xdp_info() 55 if (CHECK(prog_id != info.id, "prog_id_skb", "prog_id not available\n")) in test_xdp_info() [all …]
|
D | task_fd_query_rawtp.c | 8 __u32 len, prog_id, fd_type; in test_task_fd_query_rawtp() local 24 err = bpf_task_fd_query(getpid(), efd, 0, buf, &len, &prog_id, in test_task_fd_query_rawtp() 38 err = bpf_task_fd_query(getpid(), efd, 0, buf, &len, &prog_id, in test_task_fd_query_rawtp() 50 err = bpf_task_fd_query(getpid(), efd, 0, 0, &len, &prog_id, in test_task_fd_query_rawtp() 62 err = bpf_task_fd_query(getpid(), efd, 0, buf, &len, &prog_id, in test_task_fd_query_rawtp()
|
D | tc_bpf.c | 18 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hpi, .handle = 1, .priority = 1, .prog_id = 42); \ 22 .prog_id = 42); \ 42 !ASSERT_EQ(opts.prog_id, info.id, "prog_id set")) in test_tc_bpf_basic() 45 opts.prog_id = 0; in test_tc_bpf_basic() 51 opts.flags = opts.prog_fd = opts.prog_id = 0; in test_tc_bpf_basic() 58 !ASSERT_EQ(opts.prog_id, info.id, "prog_id set")) in test_tc_bpf_basic() 62 opts.flags = opts.prog_fd = opts.prog_id = 0; in test_tc_bpf_basic() 91 attach_opts.prog_id = 0; in test_tc_bpf_api() 115 attach_opts.prog_id = 0; in test_tc_bpf_api() 307 opts_pf.prog_fd = opts_pf.prog_id = 0; in test_tc_bpf_api() [all …]
|
D | xdp_link.c | 129 CHECK(link_info.prog_id != id1, "link_prog_id", in test_xdp_link() 130 "got %u != exp %u\n", link_info.prog_id, id1); in test_xdp_link() 142 CHECK(link_info.prog_id != id1, "link_prog_id", in test_xdp_link() 143 "got %u != exp %u\n", link_info.prog_id, id1); in test_xdp_link()
|
D | cgroup_link.c | 41 __u32 prog_ids[ARRAY_SIZE(cgs)], prog_cnt = 0, attach_flags, prog_id; in test_cgroup_link() local 221 prog_id = link_info_prog_id(links[0], &info); in test_cgroup_link() 222 CHECK(prog_id == 0, "link_info", "failed\n"); in test_cgroup_link() 230 prog_id = link_info_prog_id(links[0], &info); in test_cgroup_link() 231 CHECK(prog_id == 0, "link_info", "failed\n"); in test_cgroup_link()
|
D | task_fd_query_tp.c | 11 __u32 len, prog_id, fd_type; in test_task_fd_query_tp_core() local 54 err = bpf_task_fd_query(getpid(), pmu_fd, 0, buf, &len, &prog_id, in test_task_fd_query_tp_core()
|
D | sk_lookup.c | 523 __u32 prog_id; in query_lookup_prog() local 557 prog_id = link_info_prog_id(link[0], &info); in query_lookup_prog() 558 CHECK(prog_ids[0] != prog_id, "bpf_prog_query", in query_lookup_prog() 560 prog_ids[0], prog_id); in query_lookup_prog() 563 prog_id = link_info_prog_id(link[1], &info); in query_lookup_prog() 564 CHECK(prog_ids[1] != prog_id, "bpf_prog_query", in query_lookup_prog() 566 prog_ids[1], prog_id); in query_lookup_prog() 569 prog_id = link_info_prog_id(link[2], &info); in query_lookup_prog() 570 CHECK(prog_ids[2] != prog_id, "bpf_prog_query", in query_lookup_prog() 572 prog_ids[2], prog_id); in query_lookup_prog() [all …]
|
D | perf_link.c | 62 ASSERT_GT(info.prog_id, 0, "link_prog_id"); in test_perf_link()
|
D | flow_dissector_reattach.c | 510 CHECK_FAIL(info.prog_id != query_prog_id(prog1)); in test_link_get_info() 534 CHECK_FAIL(info.prog_id != query_prog_id(prog2)); in test_link_get_info() 559 CHECK_FAIL(info.prog_id != query_prog_id(prog2)); in test_link_get_info()
|
D | bpf_obj_id.c | 168 link_infos[i].prog_id != prog_infos[i].id || in test_bpf_obj_id() 180 link_infos[i].prog_id, prog_infos[i].id, in test_bpf_obj_id()
|
/tools/bpf/bpftool/Documentation/ |
D | bpftool-perf.rst | 52 pid 21711 fd 5: prog_id 5 kprobe func __x64_sys_write offset 0 53 pid 21765 fd 5: prog_id 7 kretprobe func __x64_sys_nanosleep offset 0 54 pid 21767 fd 5: prog_id 8 tracepoint sys_enter_nanosleep 55 pid 21800 fd 5: prog_id 9 uprobe filename /home/yhs/a.out offset 1159 62 [{"pid":21711,"fd":5,"prog_id":5,"fd_type":"kprobe","func":"__x64_sys_write","offset":0}, \ 63 … {"pid":21765,"fd":5,"prog_id":7,"fd_type":"kretprobe","func":"__x64_sys_nanosleep","offset":0}, \ 64 {"pid":21767,"fd":5,"prog_id":8,"fd_type":"tracepoint","tracepoint":"sys_enter_nanosleep"}, \ 65 {"pid":21800,"fd":5,"prog_id":9,"fd_type":"uprobe","filename":"/home/yhs/a.out","offset":1159}]
|
/tools/bpf/bpftool/ |
D | perf.c | 25 __u32 len, prog_id, fd_type; in has_perf_query_support() local 44 bpf_task_fd_query(getpid(), fd, 0, buf, &len, &prog_id, in has_perf_query_support() 63 static void print_perf_json(int pid, int fd, __u32 prog_id, __u32 fd_type, in print_perf_json() argument 69 jsonw_uint_field(json_wtr, "prog_id", prog_id); in print_perf_json() 113 static void print_perf_plain(int pid, int fd, __u32 prog_id, __u32 fd_type, in print_perf_plain() argument 116 printf("pid %d fd %d: prog_id %u ", pid, fd, prog_id); in print_perf_plain() 154 __u32 len, prog_id, fd_type; in show_proc() local 196 err = bpf_task_fd_query(pid, fd, 0, buf, &len, &prog_id, &fd_type, in show_proc() 202 print_perf_json(pid, fd, prog_id, fd_type, buf, probe_offset, in show_proc() 205 print_perf_plain(pid, fd, prog_id, fd_type, buf, probe_offset, in show_proc()
|
D | link.c | 68 jsonw_uint_field(json_wtr, "prog_id", info->prog_id); in show_link_header_json() 96 static int get_prog_info(int prog_id, struct bpf_prog_info *info) in get_prog_info() argument 101 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_prog_info() 128 err = get_prog_info(info->prog_id, &prog_info); in show_link_close_json() 186 printf("prog %u ", info->prog_id); in show_link_header_plain() 220 err = get_prog_info(info->prog_id, &prog_info); in show_link_close_plain()
|
D | btf_dumper.c | 33 __u32 prog_id) in dump_prog_id_as_func_ptr() argument 50 if (!prog_id) in dump_prog_id_as_func_ptr() 54 prog_fd = bpf_prog_get_fd_by_id(prog_id); in dump_prog_id_as_func_ptr() 80 if (!prog_id) in dump_prog_id_as_func_ptr() 86 " %s/prog_id:%u", prog_name, prog_id); in dump_prog_id_as_func_ptr() 90 " <unknown_prog_name>/prog_id:%u", prog_id); in dump_prog_id_as_func_ptr()
|
/tools/testing/selftests/bpf/ |
D | test_skb_cgroup_id_user.c | 80 int get_map_fd_by_prog_id(int prog_id) in get_map_fd_by_prog_id() argument 88 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_map_fd_by_prog_id() 90 log_err("Failed to get fd by prog id %d", prog_id); in get_map_fd_by_prog_id() 116 int check_ancestor_cgroup_ids(int prog_id) in check_ancestor_cgroup_ids() argument 128 map_fd = get_map_fd_by_prog_id(prog_id); in check_ancestor_cgroup_ids()
|
D | xdp_redirect_multi.c | 31 __u32 prog_id = 0; in int_exit() local 35 if (bpf_get_link_xdp_id(ifaces[i], &prog_id, xdp_flags)) { in int_exit() 39 if (prog_id) in int_exit()
|
D | test_tcp_check_syncookie_user.c | 81 static int get_map_fd_by_prog_id(int prog_id, bool *xdp) in get_map_fd_by_prog_id() argument 89 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_map_fd_by_prog_id() 91 log_err("Failed to get fd by prog id %d", prog_id); in get_map_fd_by_prog_id()
|
D | testing_helpers.c | 79 return info->prog_id; in link_info_prog_id()
|
/tools/lib/bpf/ |
D | netlink.c | 337 xdp_id->info.prog_id = libbpf_nla_getattr_u32( in get_xdp_info() 397 return info->prog_id; in get_xdp_id() 408 int bpf_get_link_xdp_id(int ifindex, __u32 *prog_id, __u32 flags) in bpf_get_link_xdp_id() argument 415 *prog_id = get_xdp_id(&info, flags); in bpf_get_link_xdp_id() 561 OPTS_SET(info->opts, prog_id, libbpf_nla_getattr_u32(tbb[TCA_BPF_ID])); in __get_tc_info() 607 __u32 protocol, bpf_flags, handle, priority, parent, prog_id, flags; in bpf_tc_attach() local 625 prog_id = OPTS_GET(opts, prog_id, 0); in bpf_tc_attach() 628 if (ifindex <= 0 || !prog_fd || prog_id) in bpf_tc_attach() 682 __u32 protocol = 0, handle, priority, parent, prog_id, flags; in __bpf_tc_detach() local 698 prog_id = OPTS_GET(opts, prog_id, 0); in __bpf_tc_detach() [all …]
|
D | xsk.c | 515 __u32 prog_id = 0; in xsk_create_bpf_link() local 519 err = bpf_get_link_xdp_id(ctx->ifindex, &prog_id, xsk->config.xdp_flags); in xsk_create_bpf_link() 528 if (prog_id) { in xsk_create_bpf_link() 676 static int xsk_link_lookup(int ifindex, __u32 *prog_id, int *link_fd) in xsk_link_lookup() argument 715 if (prog_id) in xsk_link_lookup() 716 *prog_id = link_info.prog_id; in xsk_link_lookup() 838 static int xsk_lookup_xdp_res(struct xsk_socket *xsk, int *xsks_map_fd, int prog_id) in xsk_lookup_xdp_res() argument 843 ctx->prog_fd = bpf_prog_get_fd_by_id(prog_id); in xsk_lookup_xdp_res() 875 __u32 prog_id = 0; in __xsk_setup_xdp_prog() local 879 err = xsk_link_lookup(ctx->ifindex, &prog_id, &ctx->link_fd); in __xsk_setup_xdp_prog() [all …]
|
/tools/perf/tests/ |
D | bpf.c | 64 enum test_llvm__testcase prog_id; member 74 .prog_id = LLVM_TESTCASE_BASE, 83 .prog_id = LLVM_TESTCASE_BASE, 94 .prog_id = LLVM_TESTCASE_BPF_PROLOGUE, 227 bpf_testcase_table[idx].prog_id, in __test__bpf()
|
/tools/perf/util/ |
D | bpf_counter.c | 102 static int bpf_program_profiler_load_one(struct evsel *evsel, u32 prog_id) in bpf_program_profiler_load_one() argument 111 prog_fd = bpf_prog_get_fd_by_id(prog_id); in bpf_program_profiler_load_one() 113 pr_err("Failed to open fd for bpf prog %u\n", prog_id); in bpf_program_profiler_load_one() 136 pr_err("Failed to get program name for bpf prog %u. Does it have BTF?\n", prog_id); in bpf_program_profiler_load_one() 144 "Does bpf prog %u have BTF?\n", prog_id); in bpf_program_profiler_load_one() 170 u32 prog_id; in bpf_program_profiler__load() local 178 prog_id = strtoul(tok, &p, 10); in bpf_program_profiler__load() 179 if (prog_id == 0 || prog_id == UINT_MAX || in bpf_program_profiler__load() 186 ret = bpf_program_profiler_load_one(evsel, prog_id); in bpf_program_profiler__load()
|
D | env.c | 31 __u32 prog_id = info_node->info_linear->info.id; in __perf_env__insert_bpf_prog_info() local 41 if (prog_id < node->info_linear->info.id) { in __perf_env__insert_bpf_prog_info() 43 } else if (prog_id > node->info_linear->info.id) { in __perf_env__insert_bpf_prog_info() 46 pr_debug("duplicated bpf prog info %u\n", prog_id); in __perf_env__insert_bpf_prog_info() 57 __u32 prog_id) in perf_env__find_bpf_prog_info() argument 67 if (prog_id < node->info_linear->info.id) in perf_env__find_bpf_prog_info() 69 else if (prog_id > node->info_linear->info.id) in perf_env__find_bpf_prog_info()
|
D | bpf_counter.h | 110 return link_info.prog_id; in bpf_link_get_prog_id()
|
D | env.h | 171 __u32 prog_id);
|