lkml.org 
[lkml]   [2009]   [Nov]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/6] perf tools: Synthetize the targeted process
    Date
    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


    \
     
     \ /
      Last update: 2009-11-11 04:53    [W:4.447 / U:0.864 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site