Home
last modified time | relevance | path

Searched refs:prog (Results 1 – 25 of 118) sorted by relevance

12345

/tools/lib/bpf/
Dlibbpf.h177 LIBBPF_API void *bpf_object__priv(const struct bpf_object *prog);
189 LIBBPF_API struct bpf_program *bpf_program__next(struct bpf_program *prog,
197 LIBBPF_API struct bpf_program *bpf_program__prev(struct bpf_program *prog,
202 LIBBPF_API int bpf_program__set_priv(struct bpf_program *prog, void *priv,
205 LIBBPF_API void *bpf_program__priv(const struct bpf_program *prog);
206 LIBBPF_API void bpf_program__set_ifindex(struct bpf_program *prog,
209 LIBBPF_API const char *bpf_program__name(const struct bpf_program *prog);
210 LIBBPF_API const char *bpf_program__section_name(const struct bpf_program *prog);
212 const char *bpf_program__title(const struct bpf_program *prog, bool needs_copy);
213 LIBBPF_API bool bpf_program__autoload(const struct bpf_program *prog);
[all …]
Dlibbpf.c73 static bool prog_is_subprog(const struct bpf_object *obj, const struct bpf_program *prog);
222 struct bpf_program *prog);
530 void bpf_program__unload(struct bpf_program *prog) in bpf_program__unload() argument
534 if (!prog) in bpf_program__unload()
541 if (prog->instances.nr > 0) { in bpf_program__unload()
542 for (i = 0; i < prog->instances.nr; i++) in bpf_program__unload()
543 zclose(prog->instances.fds[i]); in bpf_program__unload()
544 } else if (prog->instances.nr != -1) { in bpf_program__unload()
546 prog->instances.nr); in bpf_program__unload()
549 prog->instances.nr = -1; in bpf_program__unload()
[all …]
/tools/testing/selftests/bpf/prog_tests/
Dtailcalls.c13 struct bpf_program *prog; in test_tailcall_1() local
24 prog = bpf_object__find_program_by_title(obj, "classifier"); in test_tailcall_1()
25 if (CHECK_FAIL(!prog)) in test_tailcall_1()
28 main_fd = bpf_program__fd(prog); in test_tailcall_1()
43 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
44 if (CHECK_FAIL(!prog)) in test_tailcall_1()
47 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
75 prog = bpf_object__find_program_by_title(obj, prog_name); in test_tailcall_1()
76 if (CHECK_FAIL(!prog)) in test_tailcall_1()
79 prog_fd = bpf_program__fd(prog); in test_tailcall_1()
[all …]
Dtrace_ext.c24 struct bpf_program *prog; in test_trace_ext() local
38 prog = skel_pkt->progs.test_pkt_md_access; in test_trace_ext()
39 pkt_fd = bpf_program__fd(prog); in test_trace_ext()
47 prog = skel_ext->progs.test_pkt_md_access_new; in test_trace_ext()
48 bpf_program__set_attach_target(prog, pkt_fd, "test_pkt_md_access"); in test_trace_ext()
62 prog = skel_ext->progs.test_pkt_md_access_new; in test_trace_ext()
63 ext_fd = bpf_program__fd(prog); in test_trace_ext()
71 prog = skel_trace->progs.fentry; in test_trace_ext()
72 bpf_program__set_attach_target(prog, ext_fd, "test_pkt_md_access_new"); in test_trace_ext()
75 prog = skel_trace->progs.fexit; in test_trace_ext()
[all …]
Dsignal_pending.c12 struct bpf_insn prog[4096]; in test_signal_pending_by_type() local
21 for (i = 0; i < ARRAY_SIZE(prog); i++) in test_signal_pending_by_type()
22 prog[i] = BPF_ALU64_IMM(BPF_MOV, BPF_REG_0, 0); in test_signal_pending_by_type()
23 prog[ARRAY_SIZE(prog) - 1] = BPF_EXIT_INSN(); in test_signal_pending_by_type()
25 prog_fd = bpf_load_program(prog_type, prog, ARRAY_SIZE(prog), in test_signal_pending_by_type()
Dconnect_force_port.c58 struct bpf_program *prog; in run_test() local
69 prog = bpf_object__find_program_by_title(obj, v4 ? in run_test()
72 if (CHECK(!prog, "find_prog", "connect prog not found\n")) { in run_test()
77 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, v4 ? in run_test()
85 prog = bpf_object__find_program_by_title(obj, v4 ? in run_test()
88 if (CHECK(!prog, "find_prog", "getpeername prog not found\n")) { in run_test()
93 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, v4 ? in run_test()
101 prog = bpf_object__find_program_by_title(obj, v4 ? in run_test()
104 if (CHECK(!prog, "find_prog", "getsockname prog not found\n")) { in run_test()
109 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, v4 ? in run_test()
Dreference_tracking.c13 struct bpf_program *prog; in test_reference_tracking() local
26 bpf_object__for_each_program(prog, obj) { in test_reference_tracking()
30 title = bpf_program__section_name(prog); in test_reference_tracking()
42 err = !bpf_program__load(prog, "GPL", 0); in test_reference_tracking()
45 err = bpf_program__load(prog, "GPL", 0); in test_reference_tracking()
Dcore_autosize.c58 struct bpf_program *prog; in test_core_autosize() local
134 prog = bpf_object__find_program_by_name(skel->obj, "handle_signed"); in test_core_autosize()
135 if (!ASSERT_OK_PTR(prog, "prog_find")) in test_core_autosize()
137 bpf_program__set_autoload(prog, false); in test_core_autosize()
143 prog = bpf_object__find_program_by_name(skel->obj, "handle_samesize"); in test_core_autosize()
144 if (!ASSERT_OK_PTR(prog, "prog_find")) in test_core_autosize()
146 skel->links.handle_samesize = bpf_program__attach(prog); in test_core_autosize()
150 prog = bpf_object__find_program_by_name(skel->obj, "handle_downsize"); in test_core_autosize()
151 if (!ASSERT_OK_PTR(prog, "prog_find")) in test_core_autosize()
153 skel->links.handle_downsize = bpf_program__attach(prog); in test_core_autosize()
[all …]
Dfexit_bpf2bpf.c63 struct bpf_program **prog = NULL; in test_fexit_bpf2bpf_common() local
88 prog = calloc(sizeof(struct bpf_program *), prog_cnt); in test_fexit_bpf2bpf_common()
89 if (!ASSERT_OK_PTR(prog, "prog_ptr")) in test_fexit_bpf2bpf_common()
110 prog[i] = bpf_object__find_program_by_title(obj, prog_name[i]); in test_fexit_bpf2bpf_common()
111 if (!ASSERT_OK_PTR(prog[i], prog_name[i])) in test_fexit_bpf2bpf_common()
114 link[i] = bpf_program__attach_trace(prog[i]); in test_fexit_bpf2bpf_common()
124 bpf_program__get_expected_attach_type(prog[i]), in test_fexit_bpf2bpf_common()
153 free(prog); in test_fexit_bpf2bpf_common()
215 struct bpf_program *prog = NULL; in test_second_attach() local
221 prog = bpf_object__find_program_by_title(obj, prog_name); in test_second_attach()
[all …]
Dxdp_bpf2bpf.c50 struct bpf_program *prog; in test_xdp_bpf2bpf() local
72 prog = ftrace_skel->progs.trace_on_entry; in test_xdp_bpf2bpf()
73 bpf_program__set_expected_attach_type(prog, BPF_TRACE_FENTRY); in test_xdp_bpf2bpf()
74 bpf_program__set_attach_target(prog, pkt_fd, "_xdp_tx_iptunnel"); in test_xdp_bpf2bpf()
76 prog = ftrace_skel->progs.trace_on_exit; in test_xdp_bpf2bpf()
77 bpf_program__set_expected_attach_type(prog, BPF_TRACE_FEXIT); in test_xdp_bpf2bpf()
78 bpf_program__set_attach_target(prog, pkt_fd, "_xdp_tx_iptunnel"); in test_xdp_bpf2bpf()
Dstacktrace_map_raw_tp.c11 struct bpf_program *prog; in test_stacktrace_map_raw_tp() local
19 prog = bpf_object__find_program_by_title(obj, prog_name); in test_stacktrace_map_raw_tp()
20 if (CHECK(!prog, "find_prog", "prog '%s' not found\n", prog_name)) in test_stacktrace_map_raw_tp()
23 link = bpf_program__attach_raw_tracepoint(prog, "sched_switch"); in test_stacktrace_map_raw_tp()
Dcheck_mtu.c44 struct bpf_program *prog; in test_check_mtu_xdp_attach() local
53 prog = skel->progs.xdp_use_helper_basic; in test_check_mtu_xdp_attach()
55 link = bpf_program__attach_xdp(prog, IFINDEX_LO); in test_check_mtu_xdp_attach()
79 struct bpf_program *prog, in test_check_mtu_run_xdp() argument
82 const char *prog_name = bpf_program__name(prog); in test_check_mtu_run_xdp()
93 .prog_fd = bpf_program__fd(prog), in test_check_mtu_run_xdp()
139 struct bpf_program *prog, in test_check_mtu_run_tc() argument
142 const char *prog_name = bpf_program__name(prog); in test_check_mtu_run_tc()
153 .prog_fd = bpf_program__fd(prog), in test_check_mtu_run_tc()
Dstacktrace_map.c11 struct bpf_program *prog; in test_stacktrace_map() local
19 prog = bpf_object__find_program_by_title(obj, prog_name); in test_stacktrace_map()
20 if (CHECK(!prog, "find_prog", "prog '%s' not found\n", prog_name)) in test_stacktrace_map()
23 link = bpf_program__attach_tracepoint(prog, "sched", "sched_switch"); in test_stacktrace_map()
Dflow_dissector_load_bytes.c9 struct bpf_insn prog[] = { in test_flow_dissector_load_bytes() local
33 fd = bpf_load_program(BPF_PROG_TYPE_FLOW_DISSECTOR, prog, in test_flow_dissector_load_bytes()
34 ARRAY_SIZE(prog), "GPL", 0, NULL, 0); in test_flow_dissector_load_bytes()
Dsockopt_multi.c9 struct bpf_program *prog; in prog_attach() local
18 prog = bpf_object__find_program_by_title(obj, title); in prog_attach()
19 if (!prog) { in prog_attach()
24 err = bpf_prog_attach(bpf_program__fd(prog), cgroup_fd, in prog_attach()
38 struct bpf_program *prog; in prog_detach() local
45 prog = bpf_object__find_program_by_title(obj, title); in prog_detach()
46 if (!prog) in prog_detach()
49 err = bpf_prog_detach2(bpf_program__fd(prog), cgroup_fd, in prog_detach()
/tools/rcu/
Drcu-cbs.py20 def get_rdp0(prog): argument
22 rdp0 = prog.variable('rcu_preempt_data', 'kernel/rcu/tree.c');
28 rdp0 = prog.variable('rcu_sched_data',
34 rdp0 = prog.variable('rcu_data', 'kernel/rcu/tree.c');
37 rdp0 = get_rdp0(prog);
41 for cpu in for_each_possible_cpu(prog):
/tools/testing/selftests/bpf/
Dflow_dissector_load.h16 struct bpf_program *prog, *main_prog; in bpf_flow_load() local
27 bpf_object__for_each_program(prog, *obj) { in bpf_flow_load()
28 if (strcmp(section_name, bpf_program__section_name(prog)) == 0) { in bpf_flow_load()
29 main_prog = prog; in bpf_flow_load()
59 bpf_object__for_each_program(prog, *obj) { in bpf_flow_load()
60 fd = bpf_program__fd(prog); in bpf_flow_load()
Dtest_tag.c25 static struct bpf_insn prog[BPF_MAXINSNS]; variable
33 prog[i] = BPF_ALU64_IMM(BPF_MOV, i % BPF_REG_10, rand()); in bpf_gen_imm_prog()
34 prog[i - 1] = BPF_EXIT_INSN(); in bpf_gen_imm_prog()
46 memcpy(&prog[i], tmp, sizeof(tmp)); in bpf_gen_map_prog()
49 prog[insns - 2] = BPF_ALU64_IMM(BPF_MOV, i % BPF_REG_10, 42); in bpf_gen_map_prog()
50 prog[insns - 1] = BPF_EXIT_INSN(); in bpf_gen_map_prog()
60 fd_prog = bpf_load_program(BPF_PROG_TYPE_SCHED_CLS, prog, insns, "", 0, in bpf_try_load_prog()
134 size = write(fd_alg, prog, insns); in tag_from_alg()
Dtest_bpftool_metadata.sh58 bpftool prog load metadata_unused.o $BPF_DIR/unused
64 bpftool prog --json | grep '"metadata":{"a":"foo","b":1}' > /dev/null
70 bpftool prog load metadata_used.o $BPF_DIR/used
76 bpftool prog --json | grep '"metadata":{"a":"bar","b":2}' > /dev/null
/tools/cgroup/
Dmemcg_slabinfo.py36 def find_memcg_ids(css=prog['root_mem_cgroup'].css, prefix=''):
129 cfg['nr_nodes'] = prog['nr_online_nodes'].value_()
131 if prog.type('struct kmem_cache').members[1].name == 'flags':
133 elif prog.type('struct kmem_cache').members[1].name == 'batchcount':
140 if prog.type('struct obj_cgroup'):
148 def for_each_slab_page(prog): argument
149 PGSlab = 1 << prog.constant('PG_slab')
150 PGHead = 1 << prog.constant('PG_head')
152 for page in for_each_page(prog):
195 for page in for_each_slab_page(prog):
[all …]
Diocost_monitor.py42 blkcg_root = prog['blkcg_root']
43 plid = prog['blkcg_policy_iocost'].plid.value_()
47 IOC_RUNNING = prog['IOC_RUNNING'].value_()
48 WEIGHT_ONE = prog['WEIGHT_ONE'].value_()
49 VTIME_PER_SEC = prog['VTIME_PER_SEC'].value_()
50 VTIME_PER_USEC = prog['VTIME_PER_USEC'].value_()
51 AUTOP_SSD_FAST = prog['AUTOP_SSD_FAST'].value_()
52 AUTOP_SSD_DFL = prog['AUTOP_SSD_DFL'].value_()
53 AUTOP_SSD_QD1 = prog['AUTOP_SSD_QD1'].value_()
54 AUTOP_HDD = prog['AUTOP_HDD'].value_()
[all …]
/tools/bpf/bpftool/
Diter.c16 struct bpf_program *prog; in do_pin() local
60 prog = bpf_program__next(NULL, obj); in do_pin()
61 if (!prog) { in do_pin()
66 link = bpf_program__attach_iter(prog, &iter_opts); in do_pin()
70 bpf_program__name(prog)); in do_pin()
81 bpf_program__name(prog), path); in do_pin()
Dgen.c309 struct bpf_program *prog; in codegen_attach_detach() local
311 bpf_object__for_each_program(prog, obj) { in codegen_attach_detach()
321 ", obj_name, bpf_program__name(prog)); in codegen_attach_detach()
323 switch (bpf_program__get_type(prog)) { in codegen_attach_detach()
325 tp_name = strchr(bpf_program__section_name(prog), '/') + 1; in codegen_attach_detach()
342 ", bpf_program__name(prog)); in codegen_attach_detach()
355 bpf_object__for_each_program(prog, obj) { in codegen_attach_detach()
359 ", obj_name, bpf_program__name(prog)); in codegen_attach_detach()
372 bpf_object__for_each_program(prog, obj) { in codegen_attach_detach()
376 ", bpf_program__name(prog)); in codegen_attach_detach()
[all …]
/tools/bpf/bpftool/Documentation/
Dbpftool-prog.rst2 bpftool-prog
13 **bpftool** [*OPTIONS*] **prog** *COMMAND*
26 | **bpftool** **prog** { **show** | **list** } [*PROG*]
27 | **bpftool** **prog dump xlated** *PROG* [{**file** *FILE* | **opcodes** | **visual** | **linum**}]
28 | **bpftool** **prog dump jited** *PROG* [{**file** *FILE* | **opcodes** | **linum**}]
29 | **bpftool** **prog pin** *PROG* *FILE*
30 | **bpftool** **prog** { **load** | **loadall** } *OBJ* *PATH* [**type** *TYPE*] [**map** {**idx** …
31 | **bpftool** **prog attach** *PROG* *ATTACH_TYPE* [*MAP*]
32 | **bpftool** **prog detach** *PROG* *ATTACH_TYPE* [*MAP*]
33 | **bpftool** **prog tracelog**
[all …]
/tools/testing/selftests/powerpc/dscr/
Ddscr_inherit_exec_test.c19 static char *prog; variable
87 execlp(prog, prog, "exec", dscr_str, NULL); in dscr_inherit_exec()
106 prog = argv[0]; in main()

12345