Any process that makes a prctl(PR_SET_NAME) call loses its mappings,
no matter when makes the call. The perf records for that process look
like this:
COMM (for the initial exec)
MMAP (the executable)
MMAP (1st dll)
MMAP (2nd dll)
...
COMM (for the prctl)
The second COMM flushes the old mappings, and all samples from then on
cannot be classified. This is easily reproducible with a small
program, which I would be happy to send.
I found this while trying to use perf with Chrome on Chrome OS.
Chrome forks and execs all the time, and calls prctl() in the thread
library.