aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-02-11 08:45:54 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-02-11 08:45:54 -0500
commit7c940c18c57e45910f7dd9a4011c4658cacba4b6 (patch)
treed161ba063e2c959984f7a7126c3ed3be2a595d70 /tools/perf/util
parentd5e3d747007fdb541e57ed72e020ff0b94db3470 (diff)
parent401b8e1317d288f28d6e1afd13271dcb08fd9869 (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')
-rw-r--r--tools/perf/util/event.c19
-rw-r--r--tools/perf/util/event.h6
2 files changed, 18 insertions, 7 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
10static const char *perf_event__names[] = { 11static 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
268int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, 269int 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);
285out_free_comm: 294out_free_comm:
286 free(comm_event); 295 free(comm_event);
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index eecb42273d59..9c35170fb379 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -135,6 +135,7 @@ union perf_event {
135void perf_event__print_totals(void); 135void perf_event__print_totals(void);
136 136
137struct perf_session; 137struct perf_session;
138struct thread_map;
138 139
139typedef int (*perf_event__handler_synth_t)(union perf_event *event, 140typedef int (*perf_event__handler_synth_t)(union perf_event *event,
140 struct perf_session *session); 141 struct perf_session *session);
@@ -142,8 +143,9 @@ typedef int (*perf_event__handler_t)(union perf_event *event,
142 struct perf_sample *sample, 143 struct perf_sample *sample,
143 struct perf_session *session); 144 struct perf_session *session);
144 145
145int perf_event__synthesize_thread(pid_t pid, perf_event__handler_t process, 146int perf_event__synthesize_thread_map(struct thread_map *threads,
146 struct perf_session *session); 147 perf_event__handler_t process,
148 struct perf_session *session);
147int perf_event__synthesize_threads(perf_event__handler_t process, 149int perf_event__synthesize_threads(perf_event__handler_t process,
148 struct perf_session *session); 150 struct perf_session *session);
149int perf_event__synthesize_kernel_mmap(perf_event__handler_t process, 151int perf_event__synthesize_kernel_mmap(perf_event__handler_t process,