Lines Matching refs:buf
28 static int __do_read(int fd, void *buf, int size) in __do_read() argument
33 int ret = read(fd, buf, size); in __do_read()
39 int retw = write(STDOUT_FILENO, buf, ret); in __do_read()
48 buf += ret; in __do_read()
73 char buf[BUFSIZ]; in skip() local
78 do_read(buf, r); in skip()
103 char buf[BUFSIZ]; in read_string() local
130 buf[size++] = c; in read_string()
140 memcpy(str, buf, size); in read_string()
171 char *buf; in read_ftrace_printk() local
178 buf = malloc(size + 1); in read_ftrace_printk()
179 if (buf == NULL) in read_ftrace_printk()
182 if (do_read(buf, size) < 0) { in read_ftrace_printk()
183 free(buf); in read_ftrace_printk()
187 buf[size] = '\0'; in read_ftrace_printk()
189 parse_ftrace_printk(pevent, buf, size); in read_ftrace_printk()
191 free(buf); in read_ftrace_printk()
199 char buf[BUFSIZ]; in read_header_files() local
202 if (do_read(buf, 12) < 0) in read_header_files()
205 if (memcmp(buf, "header_page", 12) != 0) { in read_header_files()
232 if (do_read(buf, 13) < 0) in read_header_files()
235 if (memcmp(buf, "header_event", 13) != 0) { in read_header_files()
249 char *buf; in read_ftrace_file() local
251 buf = malloc(size); in read_ftrace_file()
252 if (buf == NULL) { in read_ftrace_file()
257 ret = do_read(buf, size); in read_ftrace_file()
263 ret = parse_ftrace_file(pevent, buf, size); in read_ftrace_file()
267 free(buf); in read_ftrace_file()
275 char *buf; in read_event_file() local
277 buf = malloc(size); in read_event_file()
278 if (buf == NULL) { in read_event_file()
283 ret = do_read(buf, size); in read_event_file()
287 ret = parse_event_file(pevent, buf, size, sys); in read_event_file()
291 free(buf); in read_event_file()
347 char *buf; in read_saved_cmdline() local
355 buf = malloc(size + 1); in read_saved_cmdline()
356 if (buf == NULL) { in read_saved_cmdline()
361 ret = do_read(buf, size); in read_saved_cmdline()
366 buf[ret] = '\0'; in read_saved_cmdline()
368 parse_saved_cmdline(pevent, buf, size); in read_saved_cmdline()
371 free(buf); in read_saved_cmdline()
377 char buf[BUFSIZ]; in trace_report() local
394 if (do_read(buf, 3) < 0) in trace_report()
396 if (memcmp(buf, test, 3) != 0) { in trace_report()
401 if (do_read(buf, 7) < 0) in trace_report()
403 if (memcmp(buf, "tracing", 7) != 0) { in trace_report()
414 if (do_read(buf, 1) < 0) { in trace_report()
418 file_bigendian = buf[0]; in trace_report()
432 if (do_read(buf, 1) < 0) in trace_report()
434 file_long_size = buf[0]; in trace_report()