android: Don't parse /proc/self/maps to prefetch the library.

This commit changes the behavior of the native library prefetcher to
rely on sentinel symbols rather than parsing /proc/self/maps.

Behavior changes:
1. This will make the code no longer prefetch .data (because we don't
   look for it in the mappings), neither the sections that are part of
   the same mapping as .text (for instance, .rodata when using
   ld.gold). This is intended.
2. As a consequence, the UMA metric
   LibraryLoader.PercentageOfResidentCodeBeforePrefetch will move, as
   both sides of the ratio will change, and the population will change
   slightly as well (since code is currently not correctly ordered on
   ARM64 and x86_64)

- Removes the reliance on a somewhat brittle parsing of a file
- Parsing /proc/self/maps costs ~50ms of CPU on a Nexus 5X (on a little
  core, as this is triggered from an AsyncTask)
- Allows to only fetch part of the native library (in a forthcoming CL)

Rationale: 
Change-Id: I0bb7b28af3c3bd4af5745e2ebcc1fbf283bcc0c1
Reviewed-on: https://chromium-review.googlesource.com/874470
Commit-Queue: Benoit L <lizeb@chromium.org>
Reviewed-by: Egor Pasko <pasko@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Reviewed-by: Matthew Cary <mattcary@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#531515}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ef6f0fb35c08f1fbe5d44a183f470d1bb7a84af7
1 file changed
tree: f9b140b6eeb39fbce6fa27abdbc0c59e2e140353
  1. tools/