[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1276086133.1645.575.camel@laptop>
Date: Wed, 09 Jun 2010 14:22:13 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Pekka Enberg <penberg@...helsinki.fi>
Cc: mingo@...hat.com, hpa@...or.com, anton@...ba.org, acme@...hat.com,
paulus@...ba.org, linux-kernel@...r.kernel.org, efault@....de,
fweisbec@...il.com, ebmunson@...ibm.com, rostedt@...dmis.org,
tglx@...utronix.de, mingo@...e.hu,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:perf/core] perf: Add non-exec mmap() tracking
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists