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