diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-15 13:18:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-15 13:18:48 -0500 |
commit | 1cecd791f2708b621e619cf4df4636c97c9497e5 (patch) | |
tree | 7d1cae2e3e0c02a5c187408fac36f0bae20fadf0 /tools/perf/util/event.c | |
parent | fef86db8feb2618430ac9e3c9b6197a7eacaf27a (diff) | |
parent | a252852afaea8270fcb91628b298253b112fc92e (diff) |
Merge branch 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'perf-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86: Fix text_poke_smp_batch() deadlock
perf tools: Fix thread_map event synthesizing in top and record
watchdog, nmi: Lower the severity of error messages
ARM: oprofile: Fix backtraces in timer mode
oprofile: Fix usage of CONFIG_HW_PERF_EVENTS for oprofile_perf_init and friends
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 1478ab4ee222..50d0a931497a 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -263,11 +263,12 @@ static int __event__synthesize_thread(event_t *comm_event, event_t *mmap_event, | |||
263 | process, session); | 263 | process, session); |
264 | } | 264 | } |
265 | 265 | ||
266 | int event__synthesize_thread(pid_t pid, event__handler_t process, | 266 | int event__synthesize_thread_map(struct thread_map *threads, |
267 | struct perf_session *session) | 267 | event__handler_t process, |
268 | struct perf_session *session) | ||
268 | { | 269 | { |
269 | event_t *comm_event, *mmap_event; | 270 | event_t *comm_event, *mmap_event; |
270 | int err = -1; | 271 | int err = -1, thread; |
271 | 272 | ||
272 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); | 273 | comm_event = malloc(sizeof(comm_event->comm) + session->id_hdr_size); |
273 | if (comm_event == NULL) | 274 | if (comm_event == NULL) |
@@ -277,8 +278,15 @@ int event__synthesize_thread(pid_t pid, event__handler_t process, | |||
277 | if (mmap_event == NULL) | 278 | if (mmap_event == NULL) |
278 | goto out_free_comm; | 279 | goto out_free_comm; |
279 | 280 | ||
280 | err = __event__synthesize_thread(comm_event, mmap_event, pid, | 281 | err = 0; |
281 | process, session); | 282 | for (thread = 0; thread < threads->nr; ++thread) { |
283 | if (__event__synthesize_thread(comm_event, mmap_event, | ||
284 | threads->map[thread], | ||
285 | process, session)) { | ||
286 | err = -1; | ||
287 | break; | ||
288 | } | ||
289 | } | ||
282 | free(mmap_event); | 290 | free(mmap_event); |
283 | out_free_comm: | 291 | out_free_comm: |
284 | free(comm_event); | 292 | free(comm_event); |