aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2012-12-18 13:49:27 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-01-24 14:40:11 -0500
commit7e383de42565ecb2cf641fff11946f9bc45e8235 (patch)
tree11a00cf495a757a7e7f2ac506d4a1984af84a5fe /tools/perf
parent5323f60c7578e9ddc92d1ca8a2d7b08284624cd1 (diff)
perf record: Don't pass host machine to guest synthesizer
We were calling perf_session__process_machines(), that would first pass the struct machine associated with the host to the provided callback, perf_event__synthesize_guest_os() that would test if it was the host and if so wouldn't do anything. Ditch this contraption, just call directly machines__process with the list of guests. Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-x65vsxgzg4dvo3zqohtrrb9o@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-record.c11
-rw-r--r--tools/perf/util/session.h9
2 files changed, 4 insertions, 16 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index de60dd4ee5d3..69e28950a328 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -328,10 +328,6 @@ static void perf_event__synthesize_guest_os(struct machine *machine, void *data)
328{ 328{
329 int err; 329 int err;
330 struct perf_tool *tool = data; 330 struct perf_tool *tool = data;
331
332 if (machine__is_host(machine))
333 return;
334
335 /* 331 /*
336 *As for guest kernel when processing subcommand record&report, 332 *As for guest kernel when processing subcommand record&report,
337 *we arrange module mmap prior to guest kernel mmap and trigger 333 *we arrange module mmap prior to guest kernel mmap and trigger
@@ -574,9 +570,10 @@ static int __cmd_record(struct perf_record *rec, int argc, const char **argv)
574 "Symbol resolution may be skewed if relocation was used (e.g. kexec).\n" 570 "Symbol resolution may be skewed if relocation was used (e.g. kexec).\n"
575 "Check /proc/modules permission or run as root.\n"); 571 "Check /proc/modules permission or run as root.\n");
576 572
577 if (perf_guest) 573 if (perf_guest) {
578 perf_session__process_machines(session, tool, 574 machines__process(&session->machines,
579 perf_event__synthesize_guest_os); 575 perf_event__synthesize_guest_os, tool);
576 }
580 577
581 if (!opts->target.system_wide) 578 if (!opts->target.system_wide)
582 err = perf_event__synthesize_thread_map(tool, evsel_list->threads, 579 err = perf_event__synthesize_thread_map(tool, evsel_list->threads,
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 8c2302504199..426ca0c3c5b6 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -101,15 +101,6 @@ struct machine *perf_session__findnew_machine(struct perf_session *self, pid_t p
101 return machines__findnew(&self->machines, pid); 101 return machines__findnew(&self->machines, pid);
102} 102}
103 103
104static inline
105void perf_session__process_machines(struct perf_session *self,
106 struct perf_tool *tool,
107 machine__process_t process)
108{
109 process(&self->host_machine, tool);
110 return machines__process(&self->machines, process, tool);
111}
112
113struct thread *perf_session__findnew(struct perf_session *self, pid_t pid); 104struct thread *perf_session__findnew(struct perf_session *self, pid_t pid);
114size_t perf_session__fprintf(struct perf_session *self, FILE *fp); 105size_t perf_session__fprintf(struct perf_session *self, FILE *fp);
115 106