Remove redundant calls of MaybeMountProcFS and refactor it.
authorMaxim Ostapenko <m.ostapenko@samsung.com>
Wed, 6 Jul 2016 10:04:28 +0000 (13:04 +0300)
committerIvan Baravy <i.baravy@samsung.com>
Mon, 27 Feb 2017 07:54:48 +0000 (10:54 +0300)
commita03c910e725dbd9031446f9974435e5f3245d8f3
treeda06122c84afcb9f2931db74b1e8c787f0c94d1d
parentb30c8e5aa393db8c6f7a7204abdf18422404b189
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