summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorKonstantin Khlebnikov <khlebnikov@yandex-team.ru>2018-08-07 12:09:01 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-08 15:55:59 -0300
commite5adfc3e7e774ba86f7bb725c6eef5f32df8630e (patch)
treed2f4e6ae01206bbcf3132633309bb72d37e6f01f /tools/perf/util/map.c
parent88cf7084f9b4b3744294b438884c2b7999b0200a (diff)
downloadlinux-stable-e5adfc3e7e774ba86f7bb725c6eef5f32df8630e.tar.gz
linux-stable-e5adfc3e7e774ba86f7bb725c6eef5f32df8630e.tar.bz2
linux-stable-e5adfc3e7e774ba86f7bb725c6eef5f32df8630e.zip
perf map: Synthesize maps only for thread group leader
Threads share map_groups, all map events are merged into it. Thus we could send mmaps only for thread group leader. Otherwise it took ages to attach and record something from processes with many vmas and threads. Thread group leader could be already dead, but it seems perf cannot handle this case anyway. Testing dummy: #include <stdio.h> #include <stdlib.h> #include <sys/mman.h> #include <pthread.h> #include <unistd.h> void *thread(void *arg) { pause(); } int main(int argc, char **argv) { int threads = 10000; int vmas = 50000; pthread_t th; for (int i = 0; i < threads; i++) pthread_create(&th, NULL, thread, NULL); for (int i = 0; i < vmas; i++) mmap(NULL, 4096, (i & 1) ? PROT_READ : PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0); sleep(60); return 0; } Comment by Jiri Olsa: We actualy synthesize the group leader (if we found one) for the thread even if it's not present in the thread_map, so the process maps are always in data. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/153363294102.396323.6277944760215058174.stgit@buzz Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.c')
0 files changed, 0 insertions, 0 deletions