aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2009-11-10 22:51:02 -0500
committerIngo Molnar <mingo@elte.hu>2009-11-11 01:30:17 -0500
commitde8967214d8ce536161a1ad6538ad1cb82e7428d (patch)
tree1f93a976adc94ba751f26ed7294d8abfc0302295 /tools
parentca2b900f9af1586b9889ccc4b12e453c13268bd5 (diff)
perf tools: Synthetize the targeted process
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> LKML-Reference: <1257911467-28276-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-record.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index ab333812ace6..9f98b86e747c 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)
497 if (target_pid == -1 && argc) { 497 if (target_pid == -1 && argc) {
498 pid = fork(); 498 pid = fork();
499 if (pid < 0) 499 if (pid < 0)
500 perror("failed to fork"); 500 die("failed to fork");
501 501
502 if (!pid) { 502 if (!pid) {
503 if (execvp(argv[0], (char **)argv)) { 503 if (execvp(argv[0], (char **)argv)) {
504 perror(argv[0]); 504 perror(argv[0]);
505 exit(-1); 505 exit(-1);
506 } 506 }
507 } else {
508 /*
509 * Wait a bit for the execv'ed child to appear
510 * and be updated in /proc
511 * FIXME: Do you know a less heuristical solution?
512 */
513 usleep(1000);
514 event__synthesize_thread(pid,
515 process_synthesized_event);
507 } 516 }
508 517
509 child_pid = pid; 518 child_pid = pid;