Lines Matching defs:buf
47 char buf[256];
50 ret = snprintf(buf, sizeof(buf), PMU_TYPE_FILE, event_type);
51 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf));
53 fd = open(buf, O_RDONLY);
56 ret = read(fd, buf, sizeof(buf));
58 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf));
61 ret = (int)strtol(buf, NULL, 10);
69 char buf[256];
72 ret = snprintf(buf, sizeof(buf), PMU_RETPROBE_FILE, event_type);
73 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf));
75 fd = open(buf, O_RDONLY);
78 ret = read(fd, buf, sizeof(buf));
80 CHECK_PERROR_RET(ret < 0 || ret >= sizeof(buf));
81 CHECK_PERROR_RET(strlen(buf) < strlen("config:"));
84 ret = (int)strtol(buf + strlen("config:"), NULL, 10);
94 char buf[256];
97 len = sizeof(buf);
98 err = bpf_task_fd_query(getpid(), event_fd[prog_fd_idx], 0, buf, &len,
107 if (strcmp(buf, fn_name) != 0 ||
112 printf("buf: %s, fd_type: %u, probe_offset: 0x%llx,"
114 buf, fd_type, probe_offset, probe_addr);
122 char *buf, __u32 *buf_len, __u32 *prog_id, __u32 *fd_type,
156 CHECK_PERROR_RET(bpf_task_fd_query(getpid(), fd, 0, buf, buf_len,
166 char *buf, __u32 buf_len)
174 buf, &buf_len, &prog_id,
191 if (strcmp(name, buf) != 0) {
192 printf("FAIL: %s, incorrect buf %s\n", __func__, buf);
202 printf("FAIL: %s, incorrect buf %p\n",
203 __func__, buf);
220 char buf[256], event_alias[sizeof("test_1234567890")];
226 snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/%s_events",
228 kfd = open(buf, O_WRONLY | O_APPEND, 0);
234 res = snprintf(buf, sizeof(buf), "%c:%ss/%s %s:0x%lx",
237 CHECK_PERROR_RET(res < 0 || res >= sizeof(buf));
238 CHECK_PERROR_RET(write(kfd, buf, strlen(buf)) < 0);
243 snprintf(buf, sizeof(buf), "/sys/kernel/debug/tracing/events/%ss/%s/id",
245 efd = open(buf, O_RDONLY, 0);
248 bytes = read(efd, buf, sizeof(buf));
249 CHECK_PERROR_RET(bytes <= 0 || bytes >= sizeof(buf));
251 buf[bytes] = '\0';
253 attr.config = strtol(buf, NULL, 0);
262 len = sizeof(buf);
263 err = bpf_task_fd_query(getpid(), kfd, 0, buf, &len,
277 if (strcmp(binary_path, buf) != 0) {
278 printf("FAIL: %s, incorrect buf %s\n", __func__, buf);
295 char filename[256], buf[256];
324 buf, sizeof(buf)));
330 buf, sizeof(buf)));
335 buf, sizeof(buf)));
340 buf, sizeof(buf)));
350 buf, sizeof(buf)));
369 buf, sizeof(buf)));
374 buf, sizeof(buf)));