diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-11 11:45:54 -0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-11 11:45:54 -0200 |
commit | 7c940c18c57e45910f7dd9a4011c4658cacba4b6 (patch) | |
tree | d161ba063e2c959984f7a7126c3ed3be2a595d70 /tools/perf | |
parent | d5e3d747007fdb541e57ed72e020ff0b94db3470 (diff) | |
parent | 401b8e1317d288f28d6e1afd13271dcb08fd9869 (diff) |
Merge remote branch 'acme/perf/urgent' into perf/core
Fixups due to rename of event_t routines from event__ to perf_event__
done in perf/core.
Conflicts:
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/util/event.c
tools/perf/util/event.h
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-record.c | 6 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 4 | ||||
-rw-r--r-- | tools/perf/util/event.c | 19 | ||||
-rw-r--r-- | tools/perf/util/event.h | 6 |
4 files changed, 23 insertions, 12 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 07f8d6d852c..12e0e41696d 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -680,9 +680,9 @@ static int __cmd_record(int argc, const char **argv) perf_event__synthesize_guest_os); if (!system_wide) - perf_event__synthesize_thread(target_tid, - process_synthesized_event, - session); + perf_event__synthesize_thread_map(evsel_list->threads, + process_synthesized_event, + session); else perf_event__synthesize_threads(process_synthesized_event, session); diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 210c736e6db..c9fd66d4a08 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -876,8 +876,8 @@ static int __cmd_top(void) return -ENOMEM; if (top.target_tid != -1) - perf_event__synthesize_thread(top.target_tid, perf_event__process, - session); + perf_event__synthesize_thread_map(top.evlist->threads, + perf_event__process, session); else perf_event__synthesize_threads(perf_event__process, session); diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 731265f4ad1..fbf5754c886 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -6,6 +6,7 @@ #include "string.h" #include "strlist.h" #include "thread.h" +#include "thread_map.h" static const char *perf_event__names[] = { [0] = "TOTAL", @@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event, process, session); } -int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, - struct perf_session *session) +int perf_event__synthesize_thread_map(struct thread_map *threads, + perf_event__handler_t process, + struct perf_session *session) { union perf_event *comm_event, *mmap_event; - int err = -1; + int err = -1, thread; comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); if (comm_event == NULL) @@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, if (mmap_event == NULL) goto out_free_comm; - err = __event__synthesize_thread(comm_event, mmap_event, pid, - process, session); + err = 0; + for (thread = 0; thread < threads->nr; ++thread) { + if (__event__synthesize_thread(comm_event, mmap_event, + threads->map[thread], + process, session)) { + err = -1; + break; + } + } free(mmap_event); out_free_comm: free(comm_event); diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index eecb42273d5..9c35170fb37 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -135,6 +135,7 @@ union perf_event { void perf_event__print_totals(void); struct perf_session; +struct thread_map; typedef int (*perf_event__handler_synth_t)(union perf_event *event, struct perf_session *session); @@ -142,8 +143,9 @@ typedef int (*perf_event__handler_t)(union perf_event *event, struct perf_sample *sample, struct perf_session *session); -int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, - struct perf_session *session); +int perf_event__synthesize_thread_map(struct thread_map *threads, + perf_event__handler_t process, + struct perf_session *session); int perf_event__synthesize_threads(perf_event__handler_t process, struct perf_session *session); int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, |