diff --git a/[refs] b/[refs] index 414f56b821f7..46f64948d2ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ca2b900f9af1586b9889ccc4b12e453c13268bd5 +refs/heads/master: de8967214d8ce536161a1ad6538ad1cb82e7428d diff --git a/trunk/tools/perf/builtin-record.c b/trunk/tools/perf/builtin-record.c index ab333812ace6..9f98b86e747c 100644 --- a/trunk/tools/perf/builtin-record.c +++ b/trunk/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;