Re: [tip:perf/core] perf: Add non-exec mmap() tracking

From: Pekka Enberg
Date: Wed Jun 09 2010 - 06:44:27 EST


H Eric,

On Wed, Jun 9, 2010 at 1:15 PM, tip-bot for Eric B Munson
<ebmunson@xxxxxxxxxx> wrote:
> Commit-ID:  3af9e859281bda7eb7c20b51879cf43aa788ac2e
> Gitweb:     http://git.kernel.org/tip/3af9e859281bda7eb7c20b51879cf43aa788ac2e
> Author:     Eric B Munson <ebmunson@xxxxxxxxxx>
> AuthorDate: Tue, 18 May 2010 15:30:49 +0100
> Committer:  Ingo Molnar <mingo@xxxxxxx>
> CommitDate: Wed, 9 Jun 2010 11:12:34 +0200
>
> perf: Add non-exec mmap() tracking
>
> Add the capacility to track data mmap()s. This can be used together
> with PERF_SAMPLE_ADDR for data profiling.
>
> Signed-off-by: Anton Blanchard <anton@xxxxxxxxx>
> [Updated code for stable perf ABI]
> Signed-off-by: Eric B Munson <ebmunson@xxxxxxxxxx>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
> Cc: Paul Mackerras <paulus@xxxxxxxxx>
> Cc: Mike Galbraith <efault@xxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> LKML-Reference: <1274193049-25997-1-git-send-email-ebmunson@xxxxxxxxxx>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

> @@ -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.

Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/