Lines Matching refs:fd

430 	int fd, err = -1;  in filename__read_build_id()  local
436 fd = open(filename, O_RDONLY); in filename__read_build_id()
437 if (fd < 0) in filename__read_build_id()
440 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in filename__read_build_id()
450 close(fd); in filename__read_build_id()
457 int fd, err = -1; in sysfs__read_build_id() local
462 fd = open(filename, O_RDONLY); in sysfs__read_build_id()
463 if (fd < 0) in sysfs__read_build_id()
471 if (read(fd, &nhdr, sizeof(nhdr)) != sizeof(nhdr)) in sysfs__read_build_id()
478 if (read(fd, bf, namesz) != (ssize_t)namesz) in sysfs__read_build_id()
482 if (read(fd, build_id, sz) == (ssize_t)sz) { in sysfs__read_build_id()
487 } else if (read(fd, bf, descsz) != (ssize_t)descsz) in sysfs__read_build_id()
491 if (read(fd, bf, n) != n) in sysfs__read_build_id()
495 close(fd); in sysfs__read_build_id()
503 int fd, err = -1; in filename__read_debuglink() local
511 fd = open(filename, O_RDONLY); in filename__read_debuglink()
512 if (fd < 0) in filename__read_debuglink()
515 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in filename__read_debuglink()
547 close(fd); in filename__read_debuglink()
582 int fd = -1; in decompress_kmodule() local
597 fd = mkstemp(tmpbuf); in decompress_kmodule()
598 if (fd < 0) { in decompress_kmodule()
603 if (!decompress_to_file(m.ext, name, fd)) { in decompress_kmodule()
605 close(fd); in decompress_kmodule()
606 fd = -1; in decompress_kmodule()
613 return fd; in decompress_kmodule()
630 close(ss->fd); in symsrc__destroy()
639 int fd; in symsrc__init() local
642 fd = decompress_kmodule(dso, name, type); in symsrc__init()
643 if (fd < 0) in symsrc__init()
646 fd = open(name, O_RDONLY); in symsrc__init()
647 if (fd < 0) { in symsrc__init()
653 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in symsrc__init()
725 ss->fd = fd; in symsrc__init()
734 close(fd); in symsrc__init()
1124 int file__read_maps(int fd, bool exe, mapfn_t mapfn, void *data, in file__read_maps() argument
1130 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in file__read_maps()
1143 enum dso_type dso__type_fd(int fd) in dso__type_fd() argument
1150 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL); in dso__type_fd()
1218 int fd; member
1228 kcore->fd = open(filename, O_RDONLY); in kcore__open()
1229 if (kcore->fd == -1) in kcore__open()
1232 kcore->elf = elf_begin(kcore->fd, ELF_C_READ, NULL); in kcore__open()
1249 close(kcore->fd); in kcore__open()
1259 kcore->fd = mkstemp(filename); in kcore__init()
1261 kcore->fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0400); in kcore__init()
1262 if (kcore->fd == -1) in kcore__init()
1265 kcore->elf = elf_begin(kcore->fd, ELF_C_WRITE, NULL); in kcore__init()
1279 close(kcore->fd); in kcore__init()
1287 close(kcore->fd); in kcore__close()
1684 if (copy_bytes(kcore.fd, kci.kernel_map.offset, extract.fd, offset, in kcore_copy()
1688 if (modules_offset && copy_bytes(kcore.fd, kci.modules_map.offset, in kcore_copy()
1689 extract.fd, modules_offset, in kcore_copy()
1742 if (copy_bytes(kcore.fd, kce->offs, extract.fd, offset, kce->len)) in kcore_extract__create()