public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] perf tools: Synthetize the targeted process
@ 2009-11-11  3:51 Frederic Weisbecker
  2009-11-11  3:51 ` [PATCH 2/6] perf tools: Move the build-id storage operations to headers Frederic Weisbecker
                   ` (5 more replies)
  0 siblings, 6 replies; 15+ messages in thread
From: Frederic Weisbecker @ 2009-11-11  3:51 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: LKML, Frederic Weisbecker, Peter Zijlstra,
	Arnaldo Carvalho de Melo, Mike Galbraith, Paul Mackerras,
	Hitoshi Mitake

Don't forget to also synthetize the targeted process from perf record
or we'll miss its dso in the events and then we won't be able to deal
with its build-id.

We are missing it because it is created after the existing synthetized
tasks but before the counters are enabled and can send its mapping
event.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
---
 tools/perf/builtin-record.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index cf2cd25..2b45d33 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -497,13 +497,22 @@ static int __cmd_record(int argc, const char **argv)
 	if (target_pid == -1 && argc) {
 		pid = fork();
 		if (pid < 0)
-			perror("failed to fork");
+			die("failed to fork");
 
 		if (!pid) {
 			if (execvp(argv[0], (char **)argv)) {
 				perror(argv[0]);
 				exit(-1);
 			}
+		} else {
+			/*
+			 * Wait a bit for the execv'ed child to appear
+			 * and be updated in /proc
+			 * FIXME: Do you know a less heuristical solution?
+			 */
+			usleep(1000);
+			event__synthesize_thread(pid,
+						 process_synthesized_event);
 		}
 
 		child_pid = pid;
-- 
1.6.2.3


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2009-11-11 17:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11  3:51 [PATCH 1/6] perf tools: Synthetize the targeted process Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 2/6] perf tools: Move the build-id storage operations to headers Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 3/6] perf tools: Split up build id saving into fetch and write Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 4/6] perf tools: Read the build-ids from the header layer Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 5/6] perf tools: Use perf_header__set/has_feat whenever possible Frederic Weisbecker
2009-11-11  7:43   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  3:51 ` [PATCH 6/6] perf tools: Bring linear set of section headers for features Frederic Weisbecker
2009-11-11  6:20   ` Peter Zijlstra
2009-11-11 16:49     ` Frederic Weisbecker
2009-11-11 17:32       ` Arnaldo Carvalho de Melo
2009-11-11  7:44   ` [tip:perf/core] " tip-bot for Frederic Weisbecker
2009-11-11  7:42 ` [tip:perf/core] perf tools: Synthetize the targeted process tip-bot for Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox