From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753259AbZKKDvB (ORCPT ); Tue, 10 Nov 2009 22:51:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752231AbZKKDvA (ORCPT ); Tue, 10 Nov 2009 22:51:00 -0500 Received: from ey-out-2122.google.com ([74.125.78.25]:65256 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752072AbZKKDu7 (ORCPT ); Tue, 10 Nov 2009 22:50:59 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=ejyWErF5XgszPk4aC4re/afJHkx4CjeYMuv4m0w+Qc6wg1tt/pFeMXpSGYsqZajwas mOabfnwLtTBDyNRoGGPCMT8n6hS1ULvUCphSysMYF3AqkSg3PvOyxVrMtDeErshPQFnR k8+CSzrm/kLnCCiy8emL/nrihyu0lL10bC26E= From: Frederic Weisbecker To: Ingo Molnar Cc: LKML , Frederic Weisbecker , Peter Zijlstra , Arnaldo Carvalho de Melo , Mike Galbraith , Paul Mackerras , Hitoshi Mitake Subject: [PATCH 1/6] perf tools: Synthetize the targeted process Date: Wed, 11 Nov 2009 04:51:02 +0100 Message-Id: <1257911467-28276-1-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.6.2.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: Peter Zijlstra Cc: Arnaldo Carvalho de Melo Cc: Mike Galbraith Cc: Paul Mackerras Cc: Hitoshi Mitake --- 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