Lines Matching refs:attr

69 long kern_sys_bpf(__u32 cmd, void *attr, __u32 attr_size);
71 static inline int skel_sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, in skel_sys_bpf() argument
75 return kern_sys_bpf(cmd, attr, size); in skel_sys_bpf()
77 return syscall(__NR_bpf, cmd, attr, size); in skel_sys_bpf()
226 union bpf_attr attr; in skel_map_create() local
228 memset(&attr, 0, attr_sz); in skel_map_create()
230 attr.map_type = map_type; in skel_map_create()
231 strncpy(attr.map_name, map_name, sizeof(attr.map_name)); in skel_map_create()
232 attr.key_size = key_size; in skel_map_create()
233 attr.value_size = value_size; in skel_map_create()
234 attr.max_entries = max_entries; in skel_map_create()
236 return skel_sys_bpf(BPF_MAP_CREATE, &attr, attr_sz); in skel_map_create()
243 union bpf_attr attr; in skel_map_update_elem() local
245 memset(&attr, 0, attr_sz); in skel_map_update_elem()
246 attr.map_fd = fd; in skel_map_update_elem()
247 attr.key = (long) key; in skel_map_update_elem()
248 attr.value = (long) value; in skel_map_update_elem()
249 attr.flags = flags; in skel_map_update_elem()
251 return skel_sys_bpf(BPF_MAP_UPDATE_ELEM, &attr, attr_sz); in skel_map_update_elem()
257 union bpf_attr attr; in skel_map_delete_elem() local
259 memset(&attr, 0, attr_sz); in skel_map_delete_elem()
260 attr.map_fd = fd; in skel_map_delete_elem()
261 attr.key = (long)key; in skel_map_delete_elem()
263 return skel_sys_bpf(BPF_MAP_DELETE_ELEM, &attr, attr_sz); in skel_map_delete_elem()
269 union bpf_attr attr; in skel_map_get_fd_by_id() local
271 memset(&attr, 0, attr_sz); in skel_map_get_fd_by_id()
272 attr.map_id = id; in skel_map_get_fd_by_id()
274 return skel_sys_bpf(BPF_MAP_GET_FD_BY_ID, &attr, attr_sz); in skel_map_get_fd_by_id()
280 union bpf_attr attr; in skel_raw_tracepoint_open() local
282 memset(&attr, 0, attr_sz); in skel_raw_tracepoint_open()
283 attr.raw_tracepoint.name = (long) name; in skel_raw_tracepoint_open()
284 attr.raw_tracepoint.prog_fd = prog_fd; in skel_raw_tracepoint_open()
286 return skel_sys_bpf(BPF_RAW_TRACEPOINT_OPEN, &attr, attr_sz); in skel_raw_tracepoint_open()
293 union bpf_attr attr; in skel_link_create() local
295 memset(&attr, 0, attr_sz); in skel_link_create()
296 attr.link_create.prog_fd = prog_fd; in skel_link_create()
297 attr.link_create.target_fd = target_fd; in skel_link_create()
298 attr.link_create.attach_type = attach_type; in skel_link_create()
300 return skel_sys_bpf(BPF_LINK_CREATE, &attr, attr_sz); in skel_link_create()
314 union bpf_attr attr; in bpf_load_and_run() local
330 memset(&attr, 0, prog_load_attr_sz); in bpf_load_and_run()
331 attr.prog_type = BPF_PROG_TYPE_SYSCALL; in bpf_load_and_run()
332 attr.insns = (long) opts->insns; in bpf_load_and_run()
333 attr.insn_cnt = opts->insns_sz / sizeof(struct bpf_insn); in bpf_load_and_run()
334 attr.license = (long) "Dual BSD/GPL"; in bpf_load_and_run()
335 memcpy(attr.prog_name, "__loader.prog", sizeof("__loader.prog")); in bpf_load_and_run()
336 attr.fd_array = (long) &map_fd; in bpf_load_and_run()
337 attr.log_level = opts->ctx->log_level; in bpf_load_and_run()
338 attr.log_size = opts->ctx->log_size; in bpf_load_and_run()
339 attr.log_buf = opts->ctx->log_buf; in bpf_load_and_run()
340 attr.prog_flags = BPF_F_SLEEPABLE; in bpf_load_and_run()
341 err = prog_fd = skel_sys_bpf(BPF_PROG_LOAD, &attr, prog_load_attr_sz); in bpf_load_and_run()
348 memset(&attr, 0, test_run_attr_sz); in bpf_load_and_run()
349 attr.test.prog_fd = prog_fd; in bpf_load_and_run()
350 attr.test.ctx_in = (long) opts->ctx; in bpf_load_and_run()
351 attr.test.ctx_size_in = opts->ctx->sz; in bpf_load_and_run()
352 err = skel_sys_bpf(BPF_PROG_RUN, &attr, test_run_attr_sz); in bpf_load_and_run()
353 if (err < 0 || (int)attr.test.retval < 0) { in bpf_load_and_run()
358 err = (int)attr.test.retval; in bpf_load_and_run()