/linux-6.1.9/tools/testing/selftests/bpf/prog_tests/ |
D | xdp_info.c | 9 __u32 len = sizeof(struct bpf_prog_info), duration = 0, prog_id; in serial_test_xdp_info() local 17 err = bpf_xdp_query_id(IFINDEX_LO, 0, &prog_id); in serial_test_xdp_info() 20 if (CHECK(prog_id, "prog_id_none", "unexpected prog_id=%u\n", prog_id)) in serial_test_xdp_info() 23 err = bpf_xdp_query_id(IFINDEX_LO, XDP_FLAGS_SKB_MODE, &prog_id); in serial_test_xdp_info() 26 if (CHECK(prog_id, "prog_id_none_skb", "unexpected prog_id=%u\n", in serial_test_xdp_info() 27 prog_id)) in serial_test_xdp_info() 46 err = bpf_xdp_query_id(IFINDEX_LO, 0, &prog_id); in serial_test_xdp_info() 49 if (CHECK(prog_id != info.id, "prog_id", "prog_id not available\n")) in serial_test_xdp_info() 52 err = bpf_xdp_query_id(IFINDEX_LO, XDP_FLAGS_SKB_MODE, &prog_id); in serial_test_xdp_info() 55 if (CHECK(prog_id != info.id, "prog_id_skb", "prog_id not available\n")) in serial_test_xdp_info() [all …]
|
D | xdp_synproxy.c | 66 char *prog_id = NULL, *prog_id_end; in test_synproxy() local 118 prog_id = memmem(buf, size, " id ", 4); in test_synproxy() 119 if (!ASSERT_OK_PTR(prog_id, "find prog id")) in test_synproxy() 121 prog_id += 4; in test_synproxy() 122 if (!ASSERT_LT(prog_id, buf + size, "find prog id begin")) in test_synproxy() 124 prog_id_end = prog_id; in test_synproxy() 156 prog_id); in test_synproxy()
|
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 | unpriv_bpf_disabled.c | 59 __u32 prog_id, int prog_fd, int perf_fd, in test_unpriv_bpf_disabled_positive() argument 119 expected_val = prog_id; in test_unpriv_bpf_disabled_positive() 142 __u32 prog_id, int prog_fd, int perf_fd, in test_unpriv_bpf_disabled_negative() argument 178 ASSERT_EQ(bpf_prog_get_fd_by_id(prog_id), -EPERM, "prog_get_fd_by_id_fails"); in test_unpriv_bpf_disabled_negative() 179 ASSERT_EQ(bpf_prog_get_next_id(prog_id, &next), -EPERM, "prog_get_next_id_fails"); in test_unpriv_bpf_disabled_negative() 234 __u32 prog_id; in test_unpriv_bpf_disabled() local 274 prog_id = prog_info.id; in test_unpriv_bpf_disabled() 275 ASSERT_GT(prog_id, 0, "valid_prog_id"); in test_unpriv_bpf_disabled() 293 test_unpriv_bpf_disabled_positive(skel, prog_id, prog_fd, perf_fd, map_paths, in test_unpriv_bpf_disabled() 297 test_unpriv_bpf_disabled_negative(skel, prog_id, prog_fd, perf_fd, map_paths, in test_unpriv_bpf_disabled()
|
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 | cgroup_link.c | 41 __u32 prog_ids[ARRAY_SIZE(cgs)], prog_cnt = 0, attach_flags, prog_id; in serial_test_cgroup_link() local 218 prog_id = link_info_prog_id(links[0], &info); in serial_test_cgroup_link() 219 CHECK(prog_id == 0, "link_info", "failed\n"); in serial_test_cgroup_link() 227 prog_id = link_info_prog_id(links[0], &info); in serial_test_cgroup_link() 228 CHECK(prog_id == 0, "link_info", "failed\n"); in serial_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 | 522 __u32 prog_id; in query_lookup_prog() local 556 prog_id = link_info_prog_id(link[0], &info); in query_lookup_prog() 557 CHECK(prog_ids[0] != prog_id, "bpf_prog_query", in query_lookup_prog() 559 prog_ids[0], prog_id); in query_lookup_prog() 562 prog_id = link_info_prog_id(link[1], &info); in query_lookup_prog() 563 CHECK(prog_ids[1] != prog_id, "bpf_prog_query", in query_lookup_prog() 565 prog_ids[1], prog_id); in query_lookup_prog() 568 prog_id = link_info_prog_id(link[2], &info); in query_lookup_prog() 569 CHECK(prog_ids[2] != prog_id, "bpf_prog_query", in query_lookup_prog() 571 prog_ids[2], prog_id); in query_lookup_prog() [all …]
|
/linux-6.1.9/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 199 &prog_id, &fd_type, in show_proc() 205 print_perf_json(pid, fd, prog_id, fd_type, buf, in show_proc() 208 print_perf_plain(pid, fd, prog_id, fd_type, buf, in show_proc()
|
D | link.c | 66 jsonw_uint_field(json_wtr, "prog_id", info->prog_id); in show_link_header_json() 138 static int get_prog_info(int prog_id, struct bpf_prog_info *info) in get_prog_info() argument 143 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_prog_info() 171 err = get_prog_info(info->prog_id, &prog_info); in show_link_close_json() 231 printf("prog %u ", info->prog_id); in show_link_header_plain() 281 err = get_prog_info(info->prog_id, &prog_info); in show_link_close_plain()
|
/linux-6.1.9/tools/bpf/bpftool/Documentation/ |
D | bpftool-perf.rst | 56 pid 21711 fd 5: prog_id 5 kprobe func __x64_sys_write offset 0 57 pid 21765 fd 5: prog_id 7 kretprobe func __x64_sys_nanosleep offset 0 58 pid 21767 fd 5: prog_id 8 tracepoint sys_enter_nanosleep 59 pid 21800 fd 5: prog_id 9 uprobe filename /home/yhs/a.out offset 1159 66 [{"pid":21711,"fd":5,"prog_id":5,"fd_type":"kprobe","func":"__x64_sys_write","offset":0}, \ 67 … {"pid":21765,"fd":5,"prog_id":7,"fd_type":"kretprobe","func":"__x64_sys_nanosleep","offset":0}, \ 68 {"pid":21767,"fd":5,"prog_id":8,"fd_type":"tracepoint","tracepoint":"sys_enter_nanosleep"}, \ 69 {"pid":21800,"fd":5,"prog_id":9,"fd_type":"uprobe","filename":"/home/yhs/a.out","offset":1159}]
|
/linux-6.1.9/tools/testing/selftests/bpf/ |
D | xdp_synproxy.c | 91 static void parse_options(int argc, char *argv[], unsigned int *ifindex, __u32 *prog_id, in parse_options() argument 115 *prog_id = 0; in parse_options() 137 *prog_id = parse_arg_ul(argv[0], optarg, UINT32_MAX); in parse_options() 138 if (*prog_id == 0) in parse_options() 181 if (*ifindex != 0 && *prog_id != 0) in parse_options() 183 if (*ifindex == 0 && *prog_id == 0) in parse_options() 270 static int syncookie_open_bpf_maps(__u32 prog_id, int *values_map_fd, int *ports_map_fd) in syncookie_open_bpf_maps() argument 282 prog_fd = bpf_prog_get_fd_by_id(prog_id); in syncookie_open_bpf_maps() 362 __u32 prog_id; in main() local 368 parse_options(argc, argv, &ifindex, &prog_id, &tcpipopts, &ports, in main() [all …]
|
D | test_skb_cgroup_id_user.c | 79 int get_map_fd_by_prog_id(int prog_id) in get_map_fd_by_prog_id() argument 87 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_map_fd_by_prog_id() 89 log_err("Failed to get fd by prog id %d", prog_id); in get_map_fd_by_prog_id() 115 int check_ancestor_cgroup_ids(int prog_id) in check_ancestor_cgroup_ids() argument 127 map_fd = get_map_fd_by_prog_id(prog_id); in check_ancestor_cgroup_ids()
|
D | xdp_redirect_multi.c | 30 __u32 prog_id = 0; in int_exit() local 34 if (bpf_xdp_query_id(ifaces[i], xdp_flags, &prog_id)) { in int_exit() 38 if (prog_id) in int_exit()
|
D | xsk.c | 494 __u32 prog_id = 0; in xsk_create_bpf_link() local 498 err = bpf_xdp_query_id(ctx->ifindex, xsk->config.xdp_flags, &prog_id); in xsk_create_bpf_link() 507 if (prog_id) { in xsk_create_bpf_link() 673 static int xsk_link_lookup(int ifindex, __u32 *prog_id, int *link_fd) in xsk_link_lookup() argument 712 if (prog_id) in xsk_link_lookup() 713 *prog_id = link_info.prog_id; in xsk_link_lookup() 826 static int xsk_lookup_xdp_res(struct xsk_socket *xsk, int *xsks_map_fd, int prog_id) in xsk_lookup_xdp_res() argument 831 ctx->prog_fd = bpf_prog_get_fd_by_id(prog_id); in xsk_lookup_xdp_res() 863 __u32 prog_id = 0; in __xsk_setup_xdp_prog() local 867 err = xsk_link_lookup(ctx->ifindex, &prog_id, &ctx->link_fd); in __xsk_setup_xdp_prog() [all …]
|
/linux-6.1.9/tools/lib/bpf/ |
D | netlink.c | 31 __u32 prog_id; member 342 xdp_id->info.prog_id = libbpf_nla_getattr_u32( in get_xdp_info() 390 OPTS_SET(opts, prog_id, xdp_id.info.prog_id); in bpf_xdp_query() 399 int bpf_xdp_query_id(int ifindex, int flags, __u32 *prog_id) in bpf_xdp_query_id() argument 411 *prog_id = opts.prog_id; in bpf_xdp_query_id() 413 *prog_id = opts.drv_prog_id; in bpf_xdp_query_id() 415 *prog_id = opts.hw_prog_id; in bpf_xdp_query_id() 417 *prog_id = opts.skb_prog_id; in bpf_xdp_query_id() 419 *prog_id = 0; in bpf_xdp_query_id() 566 OPTS_SET(info->opts, prog_id, libbpf_nla_getattr_u32(tbb[TCA_BPF_ID])); in __get_tc_info() [all …]
|
/linux-6.1.9/kernel/bpf/ |
D | prog_iter.c | 10 u32 prog_id; member 18 prog = bpf_prog_get_curr_or_next(&info->prog_id); in bpf_prog_seq_start() 32 ++info->prog_id; in bpf_prog_seq_next() 34 return bpf_prog_get_curr_or_next(&info->prog_id); in bpf_prog_seq_next()
|
/linux-6.1.9/samples/bpf/ |
D | task_fd_query_user.c | 95 __u32 len, prog_id, fd_type; in test_debug_fs_kprobe() local 102 &prog_id, &fd_type, &probe_offset, in test_debug_fs_kprobe() 125 char *buf, __u32 *buf_len, __u32 *prog_id, __u32 *fd_type, in test_nondebug_fs_kuprobe_common() argument 165 prog_id, fd_type, probe_offset, probe_addr) < 0); in test_nondebug_fs_kuprobe_common() 180 __u32 prog_id, fd_type; in test_nondebug_fs_probe() local 185 buf, &buf_len, &prog_id, in test_nondebug_fs_probe() 233 __u32 len, prog_id, fd_type; in test_debug_fs_uprobe() local 281 &prog_id, &fd_type, &probe_offset, in test_debug_fs_uprobe()
|
D | xdp1_user.c | 22 static __u32 prog_id; variable 32 if (prog_id == curr_prog_id) in int_exit() 161 prog_id = info.id; in main()
|
D | xdp_adjust_tail_user.c | 29 static __u32 prog_id; variable 40 if (prog_id == curr_prog_id) in int_exit() 192 prog_id = info.id; in main()
|
D | xdp_sample_pkts_user.c | 23 static __u32 prog_id; variable 43 prog_id = info.id; in do_attach() 58 if (prog_id == curr_prog_id) { in do_detach()
|
/linux-6.1.9/tools/perf/tests/ |
D | bpf.c | 64 enum test_llvm__testcase prog_id; member 73 .prog_id = LLVM_TESTCASE_BASE, 81 .prog_id = LLVM_TESTCASE_BASE, 91 .prog_id = LLVM_TESTCASE_BPF_PROLOGUE, 224 bpf_testcase_table[idx].prog_id, in __test__bpf()
|
/linux-6.1.9/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 | 25 __u32 prog_id = info_node->info_linear->info.id; in perf_env__insert_bpf_prog_info() local 36 if (prog_id < node->info_linear->info.id) { in perf_env__insert_bpf_prog_info() 38 } else if (prog_id > node->info_linear->info.id) { in perf_env__insert_bpf_prog_info() 41 pr_debug("duplicated bpf prog info %u\n", prog_id); in perf_env__insert_bpf_prog_info() 54 __u32 prog_id) in perf_env__find_bpf_prog_info() argument 64 if (prog_id < node->info_linear->info.id) in perf_env__find_bpf_prog_info() 66 else if (prog_id > node->info_linear->info.id) in perf_env__find_bpf_prog_info()
|
/linux-6.1.9/include/trace/events/ |
D | xdp.h | 36 __field(int, prog_id) 42 __entry->prog_id = xdp->aux->id; 48 __entry->prog_id, 100 __field(int, prog_id) 123 __entry->prog_id = xdp->aux->id; 134 __entry->prog_id,
|