/linux/tools/testing/selftests/bpf/prog_tests/ |
A 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_get_link_xdp_id(IFINDEX_LO, &prog_id, 0); 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_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_SKB_MODE); 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_get_link_xdp_id(IFINDEX_LO, &prog_id, 0); 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_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_SKB_MODE); in serial_test_xdp_info() 58 err = bpf_get_link_xdp_id(IFINDEX_LO, &prog_id, XDP_FLAGS_DRV_MODE); in serial_test_xdp_info() [all …]
|
A D | tc_bpf.c | 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() 313 opts_hf.prog_fd = opts_hf.prog_id = 0; in test_tc_bpf_api() [all …]
|
A 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()
|
A D | xdp_link.c | 129 CHECK(link_info.prog_id != id1, "link_prog_id", in serial_test_xdp_link() 130 "got %u != exp %u\n", link_info.prog_id, id1); in serial_test_xdp_link() 142 CHECK(link_info.prog_id != id1, "link_prog_id", in serial_test_xdp_link() 143 "got %u != exp %u\n", link_info.prog_id, id1); in serial_test_xdp_link()
|
A D | cgroup_link.c | 41 __u32 prog_ids[ARRAY_SIZE(cgs)], prog_cnt = 0, attach_flags, prog_id; in serial_test_cgroup_link() local 221 prog_id = link_info_prog_id(links[0], &info); in serial_test_cgroup_link() 222 CHECK(prog_id == 0, "link_info", "failed\n"); in serial_test_cgroup_link() 230 prog_id = link_info_prog_id(links[0], &info); in serial_test_cgroup_link() 231 CHECK(prog_id == 0, "link_info", "failed\n"); in serial_test_cgroup_link()
|
A 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() 572 prog_ids[2], prog_id); in query_lookup_prog() 581 prog_id = link_info_prog_id(link[0], &info); in query_lookup_prog() [all …]
|
A 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()
|
/linux/tools/bpf/bpftool/ |
A 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()
|
A D | link.c | 71 jsonw_uint_field(json_wtr, "prog_id", info->prog_id); in show_link_header_json() 99 static int get_prog_info(int prog_id, struct bpf_prog_info *info) in get_prog_info() argument 104 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_prog_info() 131 err = get_prog_info(info->prog_id, &prog_info); in show_link_close_json() 188 printf("prog %u ", info->prog_id); in show_link_header_plain() 222 err = get_prog_info(info->prog_id, &prog_info); in show_link_close_plain()
|
/linux/tools/bpf/bpftool/Documentation/ |
A 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}]
|
/linux/tools/lib/bpf/ |
A D | netlink.c | 288 xdp_id->info.prog_id = libbpf_nla_getattr_u32( in get_xdp_info() 348 return info->prog_id; in get_xdp_id() 366 *prog_id = get_xdp_id(&info, flags); in bpf_get_link_xdp_id() 576 prog_id = OPTS_GET(opts, prog_id, 0); in bpf_tc_attach() 579 if (ifindex <= 0 || !prog_fd || prog_id) in bpf_tc_attach() 633 __u32 protocol = 0, handle, priority, parent, prog_id, flags; in __bpf_tc_detach() local 649 prog_id = OPTS_GET(opts, prog_id, 0); in __bpf_tc_detach() 652 if (ifindex <= 0 || flags || prog_fd || prog_id) in __bpf_tc_detach() 704 __u32 protocol, handle, priority, parent, prog_id, flags; in bpf_tc_query() local 721 prog_id = OPTS_GET(opts, prog_id, 0); in bpf_tc_query() [all …]
|
A 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() 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() 886 err = !prog_id ? xsk_init_xdp_res(xsk, xsks_map_fd) : in __xsk_setup_xdp_prog() [all …]
|
/linux/tools/testing/selftests/bpf/ |
A 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()
|
A 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()
|
A 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()
|
/linux/kernel/bpf/ |
A 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/samples/bpf/ |
A D | task_fd_query_user.c | 96 __u32 len, prog_id, fd_type; in test_debug_fs_kprobe() local 103 &prog_id, &fd_type, &probe_offset, in test_debug_fs_kprobe() 126 char *buf, __u32 *buf_len, __u32 *prog_id, __u32 *fd_type, in test_nondebug_fs_kuprobe_common() argument 166 prog_id, fd_type, probe_offset, probe_addr) < 0); in test_nondebug_fs_kuprobe_common() 181 __u32 prog_id, fd_type; in test_nondebug_fs_probe() local 186 buf, &buf_len, &prog_id, in test_nondebug_fs_probe() 234 __u32 len, prog_id, fd_type; in test_debug_fs_uprobe() local 282 &prog_id, &fd_type, &probe_offset, in test_debug_fs_uprobe()
|
A D | xdp1_user.c | 23 static __u32 prog_id; variable 33 if (prog_id == curr_prog_id) in int_exit() 156 prog_id = info.id; in main()
|
A D | xdp_adjust_tail_user.c | 30 static __u32 prog_id; variable 41 if (prog_id == curr_prog_id) in int_exit() 186 prog_id = info.id; in main()
|
A D | xdp_sample_pkts_user.c | 24 static __u32 prog_id; variable 44 prog_id = info.id; in do_attach() 59 if (prog_id == curr_prog_id) { in do_detach()
|
A D | xdp_tx_iptunnel_user.c | 28 static __u32 prog_id; variable 39 if (prog_id == curr_prog_id) in int_exit() 301 prog_id = info.id; in main()
|
/linux/tools/perf/util/ |
A 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()
|
A 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/tools/perf/tests/ |
A 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/include/trace/events/ |
A 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,
|