diff options
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 27f992aca8b5..83b308a035c2 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -456,14 +456,14 @@ static void atexit_header(void) } } -static void event__synthesize_guest_os(struct kernel_info *kerninfo, - void *data __attribute__((unused))) +static void event__synthesize_guest_os(struct machine *machine, void *data) { int err; char *guest_kallsyms; char path[PATH_MAX]; + struct perf_session *psession = data; - if (is_host_kernel(kerninfo)) + if (machine__is_host(machine)) return; /* @@ -475,16 +475,15 @@ static void event__synthesize_guest_os(struct kernel_info *kerninfo, *in module instead of in guest kernel. */ err = event__synthesize_modules(process_synthesized_event, - session, - kerninfo); + psession, machine); if (err < 0) pr_err("Couldn't record guest kernel [%d]'s reference" - " relocation symbol.\n", kerninfo->pid); + " relocation symbol.\n", machine->pid); - if (is_default_guest(kerninfo)) + if (machine__is_default_guest(machine)) guest_kallsyms = (char *) symbol_conf.default_guest_kallsyms; else { - sprintf(path, "%s/proc/kallsyms", kerninfo->root_dir); + sprintf(path, "%s/proc/kallsyms", machine->root_dir); guest_kallsyms = path; } @@ -493,13 +492,13 @@ static void event__synthesize_guest_os(struct kernel_info *kerninfo, * have no _text sometimes. */ err = event__synthesize_kernel_mmap(process_synthesized_event, - session, kerninfo, "_text"); + psession, machine, "_text"); if (err < 0) err = event__synthesize_kernel_mmap(process_synthesized_event, - session, kerninfo, "_stext"); + psession, machine, "_stext"); if (err < 0) pr_err("Couldn't record guest kernel [%d]'s reference" - " relocation symbol.\n", kerninfo->pid); + " relocation symbol.\n", machine->pid); } static int __cmd_record(int argc, const char **argv) @@ -513,7 +512,7 @@ static int __cmd_record(int argc, const char **argv) int child_ready_pipe[2], go_pipe[2]; const bool forks = argc > 0; char buf; - struct kernel_info *kerninfo; + struct machine *machine; page_size = sysconf(_SC_PAGE_SIZE); @@ -682,31 +681,30 @@ static int __cmd_record(int argc, const char **argv) advance_output(err); } - kerninfo = kerninfo__findhost(&session->kerninfo_root); - if (!kerninfo) { + machine = perf_session__find_host_machine(session); + if (!machine) { pr_err("Couldn't find native kernel information.\n"); return -1; } err = event__synthesize_kernel_mmap(process_synthesized_event, - session, kerninfo, "_text"); + session, machine, "_text"); if (err < 0) err = event__synthesize_kernel_mmap(process_synthesized_event, - session, kerninfo, "_stext"); + session, machine, "_stext"); if (err < 0) { pr_err("Couldn't record kernel reference relocation symbol.\n"); return err; } err = event__synthesize_modules(process_synthesized_event, - session, kerninfo); + session, machine); if (err < 0) { pr_err("Couldn't record kernel reference relocation symbol.\n"); return err; } if (perf_guest) - kerninfo__process_allkernels(&session->kerninfo_root, - event__synthesize_guest_os, session); + perf_session__process_machines(session, event__synthesize_guest_os); if (!system_wide && profile_cpu == -1) event__synthesize_thread(target_tid, process_synthesized_event, |