Lines Matching refs:prog
954 static bool bpf_d_path_allowed(const struct bpf_prog *prog) in BTF_ID()
956 if (prog->type == BPF_PROG_TYPE_TRACING && in BTF_ID()
957 prog->expected_attach_type == BPF_TRACE_ITER) in BTF_ID()
960 if (prog->type == BPF_PROG_TYPE_LSM) in BTF_ID()
961 return bpf_lsm_is_sleepable_hook(prog->aux->attach_btf_id); in BTF_ID()
964 prog->aux->attach_btf_id); in BTF_ID()
1405 bpf_tracing_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in bpf_tracing_func_proto() argument
1502 return prog->aux->sleepable ? &bpf_copy_from_user_proto : NULL; in bpf_tracing_func_proto()
1504 return prog->aux->sleepable ? &bpf_copy_from_user_task_proto : NULL; in bpf_tracing_func_proto()
1533 kprobe_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in kprobe_prog_func_proto() argument
1547 return prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI ? in kprobe_prog_func_proto()
1551 return prog->expected_attach_type == BPF_TRACE_KPROBE_MULTI ? in kprobe_prog_func_proto()
1555 return bpf_tracing_func_proto(func_id, prog); in kprobe_prog_func_proto()
1561 const struct bpf_prog *prog, in kprobe_prog_is_valid_access() argument
1655 tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in tp_prog_func_proto() argument
1667 return bpf_tracing_func_proto(func_id, prog); in tp_prog_func_proto()
1672 const struct bpf_prog *prog, in tp_prog_is_valid_access() argument
1759 pe_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in pe_prog_func_proto() argument
1775 return bpf_tracing_func_proto(func_id, prog); in pe_prog_func_proto()
1894 raw_tp_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in raw_tp_prog_func_proto() argument
1904 return bpf_tracing_func_proto(func_id, prog); in raw_tp_prog_func_proto()
1909 tracing_prog_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog) in tracing_prog_func_proto() argument
1945 return prog->expected_attach_type == BPF_TRACE_ITER ? in tracing_prog_func_proto()
1949 return prog->expected_attach_type == BPF_TRACE_ITER ? in tracing_prog_func_proto()
1953 return prog->expected_attach_type == BPF_TRACE_ITER ? in tracing_prog_func_proto()
1959 return bpf_prog_has_trampoline(prog) ? &bpf_get_func_arg_proto : NULL; in tracing_prog_func_proto()
1961 return bpf_prog_has_trampoline(prog) ? &bpf_get_func_ret_proto : NULL; in tracing_prog_func_proto()
1963 return bpf_prog_has_trampoline(prog) ? &bpf_get_func_arg_cnt_proto : NULL; in tracing_prog_func_proto()
1965 return bpf_prog_has_trampoline(prog) ? &bpf_get_attach_cookie_proto_tracing : NULL; in tracing_prog_func_proto()
1967 fn = raw_tp_prog_func_proto(func_id, prog); in tracing_prog_func_proto()
1968 if (!fn && prog->expected_attach_type == BPF_TRACE_ITER) in tracing_prog_func_proto()
1969 fn = bpf_iter_get_func_proto(func_id, prog); in tracing_prog_func_proto()
1976 const struct bpf_prog *prog, in raw_tp_prog_is_valid_access() argument
1984 const struct bpf_prog *prog, in tracing_prog_is_valid_access() argument
1987 return bpf_tracing_btf_ctx_access(off, size, type, prog, info); in tracing_prog_is_valid_access()
1990 int __weak bpf_prog_test_run_tracing(struct bpf_prog *prog, in bpf_prog_test_run_tracing() argument
2019 const struct bpf_prog *prog, in raw_tp_writable_prog_is_valid_access() argument
2027 return raw_tp_prog_is_valid_access(off, size, type, prog, info); in raw_tp_writable_prog_is_valid_access()
2039 const struct bpf_prog *prog, in pe_prog_is_valid_access() argument
2079 struct bpf_prog *prog, u32 *target_size) in pe_prog_convert_ctx_access() argument
2126 struct bpf_prog *prog, in perf_event_attach_bpf_prog() argument
2137 if (prog->kprobe_override && in perf_event_attach_bpf_prog()
2144 if (event->prog) in perf_event_attach_bpf_prog()
2154 ret = bpf_prog_array_copy(old_array, NULL, prog, bpf_cookie, &new_array); in perf_event_attach_bpf_prog()
2159 event->prog = prog; in perf_event_attach_bpf_prog()
2177 if (!event->prog) in perf_event_detach_bpf_prog()
2181 ret = bpf_prog_array_copy(old_array, event->prog, NULL, 0, &new_array); in perf_event_detach_bpf_prog()
2185 bpf_prog_array_delete_safe(old_array, event->prog); in perf_event_detach_bpf_prog()
2191 bpf_prog_put(event->prog); in perf_event_detach_bpf_prog()
2192 event->prog = NULL; in perf_event_detach_bpf_prog()
2265 void __bpf_trace_run(struct bpf_prog *prog, u64 *args) in __bpf_trace_run() argument
2268 if (unlikely(this_cpu_inc_return(*(prog->active)) != 1)) { in __bpf_trace_run()
2269 bpf_prog_inc_misses_counter(prog); in __bpf_trace_run()
2273 (void) bpf_prog_run(prog, args); in __bpf_trace_run()
2276 this_cpu_dec(*(prog->active)); in __bpf_trace_run()
2303 void bpf_trace_run##x(struct bpf_prog *prog, \
2308 __bpf_trace_run(prog, args); \
2324 static int __bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *prog) in __bpf_probe_register() argument
2332 if (prog->aux->max_ctx_offset > btp->num_args * sizeof(u64)) in __bpf_probe_register()
2335 if (prog->aux->max_tp_access > btp->writable_size) in __bpf_probe_register()
2339 prog); in __bpf_probe_register()
2342 int bpf_probe_register(struct bpf_raw_event_map *btp, struct bpf_prog *prog) in bpf_probe_register() argument
2344 return __bpf_probe_register(btp, prog); in bpf_probe_register()
2347 int bpf_probe_unregister(struct bpf_raw_event_map *btp, struct bpf_prog *prog) in bpf_probe_unregister() argument
2349 return tracepoint_probe_unregister(btp->tp, (void *)btp->bpf_func, prog); in bpf_probe_unregister()
2357 struct bpf_prog *prog; in bpf_get_perf_event_info() local
2360 prog = event->prog; in bpf_get_perf_event_info()
2361 if (!prog) in bpf_get_perf_event_info()
2365 if (prog->type == BPF_PROG_TYPE_PERF_EVENT) in bpf_get_perf_event_info()
2368 *prog_id = prog->aux->id; in bpf_get_perf_event_info()
2635 err = bpf_prog_run(link->link.prog, regs); in kprobe_multi_link_prog_run()
2696 int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) in bpf_kprobe_multi_link_attach() argument
2712 if (prog->expected_attach_type != BPF_TRACE_KPROBE_MULTI) in bpf_kprobe_multi_link_attach()
2773 if (prog->kprobe_override && addrs_check_error_injection_list(addrs, cnt)) { in bpf_kprobe_multi_link_attach()
2785 &bpf_kprobe_multi_link_lops, prog); in bpf_kprobe_multi_link_attach()
2828 int bpf_kprobe_multi_link_attach(const union bpf_attr *attr, struct bpf_prog *prog) in bpf_kprobe_multi_link_attach() argument