Home
last modified time | relevance | path

Searched refs:prog_id (Results 1 – 25 of 52) sorted by relevance

123

/linux-6.6.21/tools/testing/selftests/bpf/prog_tests/
Dxdp_info.c9 __u32 len = sizeof(struct bpf_prog_info), duration = 0, prog_id; in serial_test_xdp_info() local
18 err = bpf_xdp_query_id(IFINDEX_LO, 0, &prog_id); in serial_test_xdp_info()
21 if (CHECK(prog_id, "prog_id_none", "unexpected prog_id=%u\n", prog_id)) in serial_test_xdp_info()
24 err = bpf_xdp_query_id(IFINDEX_LO, XDP_FLAGS_SKB_MODE, &prog_id); in serial_test_xdp_info()
27 if (CHECK(prog_id, "prog_id_none_skb", "unexpected prog_id=%u\n", in serial_test_xdp_info()
28 prog_id)) in serial_test_xdp_info()
47 err = bpf_xdp_query_id(IFINDEX_LO, 0, &prog_id); in serial_test_xdp_info()
50 if (CHECK(prog_id != info.id, "prog_id", "prog_id not available\n")) in serial_test_xdp_info()
53 err = bpf_xdp_query_id(IFINDEX_LO, XDP_FLAGS_SKB_MODE, &prog_id); in serial_test_xdp_info()
56 if (CHECK(prog_id != info.id, "prog_id_skb", "prog_id not available\n")) in serial_test_xdp_info()
[all …]
Dxdp_synproxy.c61 char *prog_id = NULL, *prog_id_end; in test_synproxy() local
113 prog_id = memmem(buf, size, " id ", 4); in test_synproxy()
114 if (!ASSERT_OK_PTR(prog_id, "find prog id")) in test_synproxy()
116 prog_id += 4; in test_synproxy()
117 if (!ASSERT_LT(prog_id, buf + size, "find prog id begin")) in test_synproxy()
119 prog_id_end = prog_id; in test_synproxy()
151 prog_id); in test_synproxy()
Dtask_fd_query_rawtp.c8 __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()
Dunpriv_bpf_disabled.c59 __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
182 ASSERT_EQ(bpf_prog_get_fd_by_id(prog_id), -EPERM, "prog_get_fd_by_id_fails"); in test_unpriv_bpf_disabled_negative()
183 ASSERT_EQ(bpf_prog_get_next_id(prog_id, &next), -EPERM, "prog_get_next_id_fails"); in test_unpriv_bpf_disabled_negative()
238 __u32 prog_id; in test_unpriv_bpf_disabled() local
278 prog_id = prog_info.id; in test_unpriv_bpf_disabled()
279 ASSERT_GT(prog_id, 0, "valid_prog_id"); in test_unpriv_bpf_disabled()
297 test_unpriv_bpf_disabled_positive(skel, prog_id, prog_fd, perf_fd, map_paths, in test_unpriv_bpf_disabled()
301 test_unpriv_bpf_disabled_negative(skel, prog_id, prog_fd, perf_fd, map_paths, in test_unpriv_bpf_disabled()
Dtc_bpf.c19 DECLARE_LIBBPF_OPTS(bpf_tc_opts, opts_hpi, .handle = 1, .priority = 1, .prog_id = 42); \
23 .prog_id = 42); \
43 !ASSERT_EQ(opts.prog_id, info.id, "prog_id set")) in test_tc_bpf_basic()
46 opts.prog_id = 0; in test_tc_bpf_basic()
52 opts.flags = opts.prog_fd = opts.prog_id = 0; in test_tc_bpf_basic()
59 !ASSERT_EQ(opts.prog_id, info.id, "prog_id set")) in test_tc_bpf_basic()
63 opts.flags = opts.prog_fd = opts.prog_id = 0; in test_tc_bpf_basic()
92 attach_opts.prog_id = 0; in test_tc_bpf_api()
116 attach_opts.prog_id = 0; in test_tc_bpf_api()
308 opts_pf.prog_fd = opts_pf.prog_id = 0; in test_tc_bpf_api()
[all …]
Dcgroup_link.c41 __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()
Dtask_fd_query_tp.c11 __u32 len, prog_id, fd_type; in test_task_fd_query_tp_core() local
59 err = bpf_task_fd_query(getpid(), pmu_fd, 0, buf, &len, &prog_id, in test_task_fd_query_tp_core()
Dsk_lookup.c522 __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 …]
Dxdp_link.c128 ASSERT_EQ(link_info.prog_id, id1, "link_prog_id"); in serial_test_xdp_link()
145 ASSERT_EQ(link_info.prog_id, id1, "link_prog_id"); in serial_test_xdp_link()
/linux-6.6.21/tools/bpf/bpftool/
Dperf.c27 __u32 len, prog_id, fd_type; in has_perf_query_support() local
46 bpf_task_fd_query(getpid(), fd, 0, buf, &len, &prog_id, in has_perf_query_support()
65 static void print_perf_json(int pid, int fd, __u32 prog_id, __u32 fd_type, in print_perf_json() argument
71 jsonw_uint_field(json_wtr, "prog_id", prog_id); in print_perf_json()
115 static void print_perf_plain(int pid, int fd, __u32 prog_id, __u32 fd_type, in print_perf_plain() argument
118 printf("pid %d fd %d: prog_id %u ", pid, fd, prog_id); in print_perf_plain()
156 __u32 len, prog_id, fd_type; in show_proc() local
201 &prog_id, &fd_type, in show_proc()
207 print_perf_json(pid, fd, prog_id, fd_type, buf, in show_proc()
210 print_perf_plain(pid, fd, prog_id, fd_type, buf, in show_proc()
Dbtf_dumper.c33 __u32 prog_id) in dump_prog_id_as_func_ptr() argument
52 if (!prog_id) in dump_prog_id_as_func_ptr()
56 prog_fd = bpf_prog_get_fd_by_id(prog_id); in dump_prog_id_as_func_ptr()
87 if (!prog_id) in dump_prog_id_as_func_ptr()
93 " %s/prog_id:%u", prog_name, prog_id); in dump_prog_id_as_func_ptr()
97 " <unknown_prog_name>/prog_id:%u", prog_id); in dump_prog_id_as_func_ptr()
/linux-6.6.21/tools/bpf/bpftool/Documentation/
Dbpftool-perf.rst56 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.6.21/tools/testing/selftests/bpf/
Dxdp_synproxy.c91 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()
138 *prog_id = parse_arg_ul(argv[0], optarg, UINT32_MAX); in parse_options()
139 if (*prog_id == 0) in parse_options()
182 if (*ifindex != 0 && *prog_id != 0) in parse_options()
184 if (*ifindex == 0 && *prog_id == 0) in parse_options()
272 static int syncookie_open_bpf_maps(__u32 prog_id, int *values_map_fd, int *ports_map_fd) in syncookie_open_bpf_maps() argument
284 prog_fd = bpf_prog_get_fd_by_id(prog_id); in syncookie_open_bpf_maps()
366 __u32 prog_id; in main() local
372 parse_options(argc, argv, &ifindex, &prog_id, &tcpipopts, &ports, in main()
[all …]
Dtest_skb_cgroup_id_user.c79 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()
Dxdp_redirect_multi.c30 __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()
Dtest_tcp_check_syncookie_user.c82 static int get_map_fd_by_prog_id(int prog_id, bool *xdp) in get_map_fd_by_prog_id() argument
90 prog_fd = bpf_prog_get_fd_by_id(prog_id); in get_map_fd_by_prog_id()
92 log_err("Failed to get fd by prog id %d", prog_id); in get_map_fd_by_prog_id()
/linux-6.6.21/tools/lib/bpf/
Dnetlink.c32 __u32 prog_id; member
387 xdp_id->info.prog_id = libbpf_nla_getattr_u32( in get_xdp_info()
465 OPTS_SET(opts, prog_id, xdp_id.info.prog_id); in bpf_xdp_query()
506 int bpf_xdp_query_id(int ifindex, int flags, __u32 *prog_id) in bpf_xdp_query_id() argument
518 *prog_id = opts.prog_id; in bpf_xdp_query_id()
520 *prog_id = opts.drv_prog_id; in bpf_xdp_query_id()
522 *prog_id = opts.hw_prog_id; in bpf_xdp_query_id()
524 *prog_id = opts.skb_prog_id; in bpf_xdp_query_id()
526 *prog_id = 0; in bpf_xdp_query_id()
673 OPTS_SET(info->opts, prog_id, libbpf_nla_getattr_u32(tbb[TCA_BPF_ID])); in __get_tc_info()
[all …]
/linux-6.6.21/kernel/bpf/
Dprog_iter.c10 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.6.21/samples/bpf/
Dtask_fd_query_user.c95 __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()
Dxdp_adjust_tail_user.c29 static __u32 prog_id; variable
40 if (prog_id == curr_prog_id) in int_exit()
192 prog_id = info.id; in main()
Dxdp_tx_iptunnel_user.c27 static __u32 prog_id; variable
38 if (prog_id == curr_prog_id) in int_exit()
303 prog_id = info.id; in main()
Dxdp_sample_user.c146 __u32 prog_id; member
1261 static int __sample_remove_xdp(int ifindex, __u32 prog_id, int xdp_flags) in __sample_remove_xdp() argument
1266 if (prog_id) { in __sample_remove_xdp()
1271 if (prog_id != cur_prog_id) { in __sample_remove_xdp()
1287 __u32 prog_id = 0; in sample_install_xdp() local
1309 ret = bpf_xdp_query_id(ifindex, xdp_flags, &prog_id); in sample_install_xdp()
1319 (struct xdp_desc){ ifindex, prog_id, xdp_flags }; in sample_install_xdp()
1373 __u32 prog_id; in sample_exit() local
1375 prog_id = sample_xdp_progs[i].prog_id; in sample_exit()
1379 __sample_remove_xdp(ifindex, prog_id, xdp_flags); in sample_exit()
/linux-6.6.21/tools/perf/util/
Dbpf_counter.c102 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()
Denv.c33 __u32 prog_id = info_node->info_linear->info.id; in __perf_env__insert_bpf_prog_info() local
43 if (prog_id < node->info_linear->info.id) { in __perf_env__insert_bpf_prog_info()
45 } else if (prog_id > node->info_linear->info.id) { in __perf_env__insert_bpf_prog_info()
48 pr_debug("duplicated bpf prog info %u\n", prog_id); in __perf_env__insert_bpf_prog_info()
59 __u32 prog_id) in perf_env__find_bpf_prog_info() argument
69 if (prog_id < node->info_linear->info.id) in perf_env__find_bpf_prog_info()
71 else if (prog_id > node->info_linear->info.id) in perf_env__find_bpf_prog_info()
/linux-6.6.21/include/trace/events/
Dxdp.h37 __field(int, prog_id)
43 __entry->prog_id = xdp->aux->id;
49 __entry->prog_id,
101 __field(int, prog_id)
124 __entry->prog_id = xdp->aux->id;
135 __entry->prog_id,

123