Remove redundant calls of MaybeMountProcFS and refactor it. 96/79196/4
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Wed, 6 Jul 2016 10:04:28 +0000 (13:04 +0300)
committerMaxim Ostapenko <m.ostapenko@samsung.com>
Tue, 26 Jul 2016 10:44:41 +0000 (13:44 +0300)
commit5599418e14246cc34b3ac73aea0b57f49dbdaaee
treec081c567ef2f02b2eac7e9acbf5397f1b5b20f7c
parentaa0b600741087b0bdc166b52080cbf8759cd01a4
Remove redundant calls of MaybeMountProcFS and refactor it.

It seems that we have lots of redundant MaybeMountProcFS, in particular
each mapped sanitized shared library calls it from AsanInitializer constructor.
Remove redudant MaybeMountProcFS calls from AsanInitializer and __asan_init.

Also, it seems that under qemu-aarch64 opening /proc/self/maps for reading
might be very expensive, so replace OpenFile("/proc/self/maps", RdOnly) with
FileExists("/proc/self/maps") in MaybeMountProcFS to avoid expensive calls.

Change-Id: I8ba28dbbc102be519fa2b284520509f601ec5cf7
Signed-off-by: Maxim Ostapenko <m.ostapenko@samsung.com>
libsanitizer/asan/asan_rtl.cc