All of lore.kernel.org
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Bram Stolk <b.stolk@gmail.com>
Cc: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>,
	linux-perf-users@vger.kernel.org, kernel-team@lge.com
Subject: Re: Adding a recording delay interferes with symbols/call-stack
Date: Thu, 2 Nov 2017 15:20:52 +0900	[thread overview]
Message-ID: <20171102062052.GB23303@sejong> (raw)
In-Reply-To: <CABYXEktgnCoc7tTzeOaT-e=ggYPAVHRk=R2tc64NgCtphL1-aw@mail.gmail.com>

Hello,

On Tue, Oct 31, 2017 at 09:36:20PM -0700, Bram Stolk wrote:
> On Tue, Oct 31, 2017 at 12:14 PM, Arnaldo Carvalho de Melo
> <arnaldo.melo@gmail.com> wrote:
> > Em Tue, Oct 31, 2017 at 10:10:28AM -0700, Bram Stolk escreveu:
> >> Thanks for trying to reproduce, Arnaldo.
> >>
> >> But for me, it's not the kernel symbols that are missing: they are all
> >> there, syscalls and stuff.
> >> Just the app's symbols itself are missing.
> >>
> >> What happens if you try it on a binary you built locally, that spends
> >> cycles in userspace?

The problem is that FORK, COMM and MMAP2 events were not generated for
the workload given on the command line.  Normally they are generated
by kernel during exec for this case (target__none).  But initial_delay
makes the attr->enable_on_exec bit cleared so kernel won't generate
the evetns for us.  System-wide and existing process cases are not
affected since they always synthesize the events.

Could you please check below patch solves your problem?

Thanks,
Namhyung


diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index f4d9fc54b382..89a192dc235c 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -949,6 +949,14 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 
        if (opts->initial_delay) {
                usleep(opts->initial_delay * USEC_PER_MSEC);
+
+               /*
+                * it did not set attr.enable_on_exec so misses
+                * task and mmap events.
+                */
+               if (target__none(&rec->opts.target))
+                       record__synthesize_workload(rec, false);
+
                perf_evlist__enable(rec->evlist);
        }
 

  reply	other threads:[~2017-11-02  6:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 20:25 Adding a recording delay interferes with symbols/call-stack Bram Stolk
2017-10-31 14:25 ` Arnaldo Carvalho de Melo
2017-10-31 17:10   ` Bram Stolk
2017-10-31 19:14     ` Arnaldo Carvalho de Melo
2017-11-01  4:36       ` Bram Stolk
2017-11-02  6:20         ` Namhyung Kim [this message]
2017-11-02  7:01           ` Bram Stolk
2017-11-02  7:07             ` Namhyung Kim
2017-11-02  7:10               ` Bram Stolk
2017-11-03 18:41             ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171102062052.GB23303@sejong \
    --to=namhyung@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=b.stolk@gmail.com \
    --cc=kernel-team@lge.com \
    --cc=linux-perf-users@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.