Lines Matching refs:buf

49 	char buf[256];  in bpf_find_probe_type()  local
52 ret = snprintf(buf, sizeof(buf), PMU_TYPE_FILE, event_type); in bpf_find_probe_type()
53 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf)); in bpf_find_probe_type()
55 fd = open(buf, O_RDONLY); in bpf_find_probe_type()
58 ret = read(fd, buf, sizeof(buf)); in bpf_find_probe_type()
60 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf)); in bpf_find_probe_type()
63 ret = (int)strtol(buf, NULL, 10); in bpf_find_probe_type()
71 char buf[256]; in bpf_get_retprobe_bit() local
74 ret = snprintf(buf, sizeof(buf), PMU_RETPROBE_FILE, event_type); in bpf_get_retprobe_bit()
75 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf)); in bpf_get_retprobe_bit()
77 fd = open(buf, O_RDONLY); in bpf_get_retprobe_bit()
80 ret = read(fd, buf, sizeof(buf)); in bpf_get_retprobe_bit()
82 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf)); in bpf_get_retprobe_bit()
83 CHECK_PERROR_RET(strlen(buf) < strlen("config:")); in bpf_get_retprobe_bit()
86 ret = (int)strtol(buf + strlen("config:"), NULL, 10); in bpf_get_retprobe_bit()
97 char buf[256]; in test_debug_fs_kprobe() local
99 len = sizeof(buf); in test_debug_fs_kprobe()
101 err = bpf_task_fd_query(getpid(), event_fd, 0, buf, &len, in test_debug_fs_kprobe()
110 if (strcmp(buf, fn_name) != 0 || in test_debug_fs_kprobe()
117 buf, fd_type, probe_offset, probe_addr); in test_debug_fs_kprobe()
125 char *buf, __u32 *buf_len, __u32 *prog_id, __u32 *fd_type, in test_nondebug_fs_kuprobe_common() argument
164 CHECK_PERROR_RET(bpf_task_fd_query(getpid(), fd, 0, buf, buf_len, in test_nondebug_fs_kuprobe_common()
177 char *buf, __u32 buf_len) in test_nondebug_fs_probe() argument
185 buf, &buf_len, &prog_id, in test_nondebug_fs_probe()
202 if (strcmp(name, buf) != 0) { in test_nondebug_fs_probe()
203 printf("FAIL: %s, incorrect buf %s\n", __func__, buf); in test_nondebug_fs_probe()
214 __func__, buf); in test_nondebug_fs_probe()
229 char buf[256], event_alias[sizeof("test_1234567890")]; in test_debug_fs_uprobe() local
238 snprintf(buf, sizeof(buf), "/sys/kernel/tracing/%s_events", in test_debug_fs_uprobe()
240 kfd = open(buf, O_WRONLY | O_TRUNC, 0); in test_debug_fs_uprobe()
246 res = snprintf(buf, sizeof(buf), "%c:%ss/%s %s:0x%lx", in test_debug_fs_uprobe()
249 CHECK_PERROR_RET(res < 0 || res >= sizeof(buf)); in test_debug_fs_uprobe()
250 CHECK_PERROR_RET(write(kfd, buf, strlen(buf)) < 0); in test_debug_fs_uprobe()
255 snprintf(buf, sizeof(buf), "/sys/kernel/tracing/events/%ss/%s/id", in test_debug_fs_uprobe()
257 efd = open(buf, O_RDONLY, 0); in test_debug_fs_uprobe()
260 bytes = read(efd, buf, sizeof(buf)); in test_debug_fs_uprobe()
261 CHECK_PERROR_RET(bytes <= 0 || bytes >= sizeof(buf)); in test_debug_fs_uprobe()
263 buf[bytes] = '\0'; in test_debug_fs_uprobe()
265 attr.config = strtol(buf, NULL, 0); in test_debug_fs_uprobe()
279 len = sizeof(buf); in test_debug_fs_uprobe()
280 err = bpf_task_fd_query(getpid(), kfd, 0, buf, &len, in test_debug_fs_uprobe()
294 if (strcmp(binary_path, buf) != 0) { in test_debug_fs_uprobe()
295 printf("FAIL: %s, incorrect buf %s\n", __func__, buf); in test_debug_fs_uprobe()
313 char filename[256], buf[256]; in main() local
358 buf, sizeof(buf))); in main()
364 buf, sizeof(buf))); in main()
369 buf, sizeof(buf))); in main()
374 buf, sizeof(buf))); in main()
384 buf, sizeof(buf))); in main()
403 buf, sizeof(buf))); in main()
408 buf, sizeof(buf))); in main()