From a33fbd56ec83b5421090b4d8f2032f635e6a9488 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 11 Nov 2013 11:36:12 -0300 Subject: perf machine: Simplify synthesize_threads method Several tools (top, kvm) don't need to be called back to process each of the syntheiszed records, instead relying on the machine__process_event function to change the per machine data structures that represent threads and mmaps, so provide a way to ask for this common idiom. Cc: Adrian Hunter Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-pusqibp8n3c4ynegd1frn4zd@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/machine.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tools/perf/util/machine.h') diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 14a89d2aecaf..fedd1dfaf715 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h @@ -179,7 +179,15 @@ int machine__for_each_thread(struct machine *machine, int (*fn)(struct thread *thread, void *p), void *priv); -int machine__synthesize_threads(struct machine *machine, struct perf_tool *tool, - struct perf_target *target, struct thread_map *threads, - perf_event__handler_t process, bool data_mmap); +int __machine__synthesize_threads(struct machine *machine, struct perf_tool *tool, + struct perf_target *target, struct thread_map *threads, + perf_event__handler_t process, bool data_mmap); +static inline +int machine__synthesize_threads(struct machine *machine, struct perf_target *target, + struct thread_map *threads, bool data_mmap) +{ + return __machine__synthesize_threads(machine, NULL, target, threads, + perf_event__process, data_mmap); +} + #endif /* __PERF_MACHINE_H */ -- cgit v1.2.3