summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-diff.c
diff options
context:
space:
mode:
authorDavid Miller2012-11-10 20:12:19 +0100
committerArnaldo Carvalho de Melo2012-12-09 12:46:05 +0100
commit35d48ddfc0627443bd7ad2750a3f65d42cb742a0 (patch)
tree3ac86ffb8e5ee95dda5bce17814fb53c550e944a /tools/perf/builtin-diff.c
parentperf top: Add missing newline on pr_err call (diff)
downloadkernel-qcow2-linux-35d48ddfc0627443bd7ad2750a3f65d42cb742a0.tar.gz
kernel-qcow2-linux-35d48ddfc0627443bd7ad2750a3f65d42cb742a0.tar.xz
kernel-qcow2-linux-35d48ddfc0627443bd7ad2750a3f65d42cb742a0.zip
perf tools: Fix mmap limitations on 32-bit
This is a suggested patch to fix the bug I reported at: http://marc.info/?l=linux-kernel&m=135033028924652&w=2 Essentially, there is a hard requirement that when perf analyzes a trace, it must have the entire thing mmap()'d. Therefore the scheme used on 32-bit where we have a fixed (8) number of 32MB mmaps, and cycle through them, simply does not work. One of the reasons this requirement exists is because the iterators maintain references to perf entry objects and those references don't just simply go away when this mmap code decides to cycle an old mmap area out and reuse it. At this point, those entry pointers now point to garbage resulting in unpredictable behavior and crashes. It is better to try to mmap() as much as we can and if we do actually run into address space limitations, the failure of the mmap() call will indicate that and stop processing. I noticed that perf_session->mmap_window is set to a constant in one location, and only used in one other location. So I got rid of it altogether. So we adjust the size of the mmaps[] array to the maximum we could need. On 64-bit we only need one slot. On 32-bit we could need up to 128 (128 * 32MB == 4GB). I've verified that this allows a large (~600MB) perf.data file to be analyzed properly with a 32-bit perf binary, which previously was not possible. Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Ingo Molnar <mingo@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/20121110.141219.582924082787523608.davem@davemloft.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-diff.c')
0 files changed, 0 insertions, 0 deletions