Symbol: kcore
tools/perf/builtin-record.c
2520
if (rec->opts.kcore &&
tools/perf/builtin-record.c
2573
if (rec->opts.kcore) {
tools/perf/builtin-record.c
3543
OPT_BOOLEAN(0, "kcore", &record.opts.kcore, "copy /proc/kcore"),
tools/perf/builtin-record.c
4161
if (rec->opts.kcore)
tools/perf/builtin-record.c
4164
if (rec->opts.kcore || record__threads_enabled(rec))
tools/perf/builtin-record.c
979
char kcore[PATH_MAX];
tools/perf/builtin-record.c
982
scnprintf(kcore, sizeof(kcore), "%s/proc/kcore", machine->root_dir);
tools/perf/builtin-record.c
984
fd = open(kcore, O_RDONLY);
tools/perf/util/record.h
55
bool kcore;
tools/perf/util/symbol-elf.c
1996
static int kcore__open(struct kcore *kcore, const char *filename)
tools/perf/util/symbol-elf.c
2000
kcore->fd = open(filename, O_RDONLY | O_CLOEXEC);
tools/perf/util/symbol-elf.c
2001
if (kcore->fd == -1)
tools/perf/util/symbol-elf.c
2004
kcore->elf = elf_begin(kcore->fd, ELF_C_READ, NULL);
tools/perf/util/symbol-elf.c
2005
if (!kcore->elf)
tools/perf/util/symbol-elf.c
2008
kcore->elfclass = gelf_getclass(kcore->elf);
tools/perf/util/symbol-elf.c
2009
if (kcore->elfclass == ELFCLASSNONE)
tools/perf/util/symbol-elf.c
2012
ehdr = gelf_getehdr(kcore->elf, &kcore->ehdr);
tools/perf/util/symbol-elf.c
2019
elf_end(kcore->elf);
tools/perf/util/symbol-elf.c
2021
close(kcore->fd);
tools/perf/util/symbol-elf.c
2025
static int kcore__init(struct kcore *kcore, char *filename, int elfclass,
tools/perf/util/symbol-elf.c
2028
kcore->elfclass = elfclass;
tools/perf/util/symbol-elf.c
2031
kcore->fd = mkostemp(filename, O_CLOEXEC);
tools/perf/util/symbol-elf.c
2033
kcore->fd = open(filename, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0400);
tools/perf/util/symbol-elf.c
2034
if (kcore->fd == -1)
tools/perf/util/symbol-elf.c
2037
kcore->elf = elf_begin(kcore->fd, ELF_C_WRITE, NULL);
tools/perf/util/symbol-elf.c
2038
if (!kcore->elf)
tools/perf/util/symbol-elf.c
2041
if (!gelf_newehdr(kcore->elf, elfclass))
tools/perf/util/symbol-elf.c
2044
memset(&kcore->ehdr, 0, sizeof(GElf_Ehdr));
tools/perf/util/symbol-elf.c
2049
elf_end(kcore->elf);
tools/perf/util/symbol-elf.c
2051
close(kcore->fd);
tools/perf/util/symbol-elf.c
2056
static void kcore__close(struct kcore *kcore)
tools/perf/util/symbol-elf.c
2058
elf_end(kcore->elf);
tools/perf/util/symbol-elf.c
2059
close(kcore->fd);
tools/perf/util/symbol-elf.c
2062
static int kcore__copy_hdr(struct kcore *from, struct kcore *to, size_t count)
tools/perf/util/symbol-elf.c
2098
static int kcore__add_phdr(struct kcore *kcore, int idx, off_t offset,
tools/perf/util/symbol-elf.c
2112
if (!gelf_update_phdr(kcore->elf, idx, &phdr))
tools/perf/util/symbol-elf.c
2118
static off_t kcore__write(struct kcore *kcore)
tools/perf/util/symbol-elf.c
2120
return elf_update(kcore->elf, ELF_C_WRITE);
tools/perf/util/symbol-elf.c
2563
struct kcore kcore;
tools/perf/util/symbol-elf.c
2564
struct kcore extract;
tools/perf/util/symbol-elf.c
2584
if (kcore__open(&kcore, kcore_filename))
tools/perf/util/symbol-elf.c
2587
if (kcore_copy__calc_maps(&kci, from_dir, kcore.elf))
tools/perf/util/symbol-elf.c
2590
if (kcore__init(&extract, extract_filename, kcore.elfclass, false))
tools/perf/util/symbol-elf.c
2593
if (kcore__copy_hdr(&kcore, &extract, kci.phnum))
tools/perf/util/symbol-elf.c
2616
if (copy_bytes(kcore.fd, p->offset, extract.fd, offs, p->len))
tools/perf/util/symbol-elf.c
2630
kcore__close(&kcore);
tools/perf/util/symbol-elf.c
2646
struct kcore kcore;
tools/perf/util/symbol-elf.c
2647
struct kcore extract;
tools/perf/util/symbol-elf.c
2652
if (kcore__open(&kcore, kce->kcore_filename))
tools/perf/util/symbol-elf.c
2656
if (kcore__init(&extract, kce->extract_filename, kcore.elfclass, true))
tools/perf/util/symbol-elf.c
2659
if (kcore__copy_hdr(&kcore, &extract, count))
tools/perf/util/symbol-elf.c
2669
if (copy_bytes(kcore.fd, kce->offs, extract.fd, offset, kce->len))
tools/perf/util/symbol-elf.c
2679
kcore__close(&kcore);