diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-11 09:28:02 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-11 13:56:39 -0500 |
commit | 58d925dcede9e8765876707a33a3406011fe1c11 (patch) | |
tree | f2fe20989a9d7be863f746d970e999d3f1ec3458 /tools/perf/util | |
parent | 62605dc50c27bf0e4ff69b7b3166f226586aff02 (diff) |
perf machine: Introduce synthesize_threads method out of open coded equivalent
Further simplifications to be done on following patch, as most tools
don't use the callback, using instead just the canned
machine__process_event one.
Cc: Adrian Hunter <adrian.hunter@intel.com>
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: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-r1m0vuuj3cat4bampno9yc8d@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/machine.c | 12 | ||||
-rw-r--r-- | tools/perf/util/machine.h | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index ce034c183a7e..9f2c61d5a9ed 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c | |||
@@ -1394,3 +1394,15 @@ int machine__for_each_thread(struct machine *machine, | |||
1394 | } | 1394 | } |
1395 | return rc; | 1395 | return rc; |
1396 | } | 1396 | } |
1397 | |||
1398 | int machine__synthesize_threads(struct machine *machine, struct perf_tool *tool, | ||
1399 | struct perf_target *target, struct thread_map *threads, | ||
1400 | perf_event__handler_t process, bool data_mmap) | ||
1401 | { | ||
1402 | if (perf_target__has_task(target)) | ||
1403 | return perf_event__synthesize_thread_map(tool, threads, process, machine, data_mmap); | ||
1404 | else if (perf_target__has_cpu(target)) | ||
1405 | return perf_event__synthesize_threads(tool, process, machine, data_mmap); | ||
1406 | /* command specified */ | ||
1407 | return 0; | ||
1408 | } | ||
diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 2389ba81fafe..14a89d2aecaf 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <sys/types.h> | 4 | #include <sys/types.h> |
5 | #include <linux/rbtree.h> | 5 | #include <linux/rbtree.h> |
6 | #include "map.h" | 6 | #include "map.h" |
7 | #include "event.h" | ||
7 | 8 | ||
8 | struct addr_location; | 9 | struct addr_location; |
9 | struct branch_stack; | 10 | struct branch_stack; |
@@ -178,4 +179,7 @@ int machine__for_each_thread(struct machine *machine, | |||
178 | int (*fn)(struct thread *thread, void *p), | 179 | int (*fn)(struct thread *thread, void *p), |
179 | void *priv); | 180 | void *priv); |
180 | 181 | ||
182 | int machine__synthesize_threads(struct machine *machine, struct perf_tool *tool, | ||
183 | struct perf_target *target, struct thread_map *threads, | ||
184 | perf_event__handler_t process, bool data_mmap); | ||
181 | #endif /* __PERF_MACHINE_H */ | 185 | #endif /* __PERF_MACHINE_H */ |