public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: mingo@redhat.com, hpa@zytor.com, anton@samba.org,
	acme@redhat.com, paulus@samba.org, linux-kernel@vger.kernel.org,
	efault@gmx.de, fweisbec@gmail.com, ebmunson@us.ibm.com,
	rostedt@goodmis.org, tglx@linutronix.de, mingo@elte.hu,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:perf/core] perf: Add non-exec mmap() tracking
Date: Wed, 09 Jun 2010 14:22:13 +0200	[thread overview]
Message-ID: <1276086133.1645.575.camel@laptop> (raw)
In-Reply-To: <AANLkTimsd32TL44V-aXvEoa3SE63X6qaOmMny9Q8uNRi@mail.gmail.com>

On Wed, 2010-06-09 at 13:44 +0300, Pekka Enberg wrote:
> > @@ -3830,6 +3834,14 @@ static void perf_event_mmap_event(struct perf_mmap_event *mmap_event)
> >                if (!vma->vm_mm) {
> >                        name = strncpy(tmp, "[vdso]", sizeof(tmp));
> >                        goto got_name;
> > +               } else if (vma->vm_start <= vma->vm_mm->start_brk &&
> > +                               vma->vm_end >= vma->vm_mm->brk) {
> > +                       name = strncpy(tmp, "[heap]", sizeof(tmp));
> > +                       goto got_name;
> > +               } else if (vma->vm_start <= vma->vm_mm->start_stack &&
> > +                               vma->vm_end >= vma->vm_mm->start_stack) {
> > +                       name = strncpy(tmp, "[stack]", sizeof(tmp));
> > +                       goto got_name;
> >                }
> >
> >                name = strncpy(tmp, "//anon", sizeof(tmp));
> 
> Doesn't this change here break the JIT generated code region detection
> in map__new() of tools/perf/util/map.c? We generate a new
> "/tmp/perf-<pid>.map" filename for anonymous memory regions and check
> for that in dso__load() of tools/perf/util/symbol.c. 

Not unless you stick your executable code in the heap or on the stack.

If you use something like mmap(NULL, size, PROT_READ|PROT_WRITE|
PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); to allocate your memory
everything should be fine.




  reply	other threads:[~2010-06-09 12:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 14:30 [PATCH V3] Split executable and non-executable mmap tracking Eric B Munson
2010-05-25  9:39 ` Peter Zijlstra
2010-06-09 10:15 ` [tip:perf/core] perf: Add non-exec mmap() tracking tip-bot for Eric B Munson
2010-06-09 10:44   ` Pekka Enberg
2010-06-09 12:22     ` Peter Zijlstra [this message]
2010-06-09 12:53       ` Pekka Enberg

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=1276086133.1645.575.camel@laptop \
    --to=peterz@infradead.org \
    --cc=acme@redhat.com \
    --cc=anton@samba.org \
    --cc=ebmunson@us.ibm.com \
    --cc=efault@gmx.de \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox