diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-11 08:45:54 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-11 08:45:54 -0500 |
commit | 7c940c18c57e45910f7dd9a4011c4658cacba4b6 (patch) | |
tree | d161ba063e2c959984f7a7126c3ed3be2a595d70 /tools/perf/util/event.c | |
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/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 731265f4ad19..fbf5754c8866 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "string.h" | 6 | #include "string.h" |
7 | #include "strlist.h" | 7 | #include "strlist.h" |
8 | #include "thread.h" | 8 | #include "thread.h" |
9 | #include "thread_map.h" | ||
9 | 10 | ||
10 | static const char *perf_event__names[] = { | 11 | static const char *perf_event__names[] = { |
11 | [0] = "TOTAL", | 12 | [0] = "TOTAL", |
@@ -265,11 +266,12 @@ static int __event__synthesize_thread(union perf_event *comm_event, | |||
265 | process, session); | 266 | process, session); |
266 | } | 267 | } |
267 | 268 | ||
268 | int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, | 269 | int perf_event__synthesize_thread_map(struct thread_map *threads, |
269 | struct perf_session *session) | 270 | perf_event__handler_t process, |
271 | struct perf_session *session) | ||
270 | { | 272 | { |
271 | union perf_event *comm_event, *mmap_event; | 273 | union perf_event *comm_event, *mmap_event; |
272 | int err = -1; | 274 | int err = -1, thread; |
273 | 275 | ||
274 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); | 276 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); |
275 | if (comm_event == NULL) | 277 | if (comm_event == NULL) |
@@ -279,8 +281,15 @@ int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, | |||
279 | if (mmap_event == NULL) | 281 | if (mmap_event == NULL) |
280 | goto out_free_comm; | 282 | goto out_free_comm; |
281 | 283 | ||
282 | err = __event__synthesize_thread(comm_event, mmap_event, pid, | 284 | err = 0; |
283 | process, session); | 285 | for (thread = 0; thread < threads->nr; ++thread) { |
286 | if (__event__synthesize_thread(comm_event, mmap_event, | ||
287 | threads->map[thread], | ||
288 | process, session)) { | ||
289 | err = -1; | ||
290 | break; | ||
291 | } | ||
292 | } | ||
284 | free(mmap_event); | 293 | free(mmap_event); |
285 | out_free_comm: | 294 | out_free_comm: |
286 | free(comm_event); | 295 | free(comm_event); |