simpleperf: Change paths of binaries stored in binary_cache

Currently we store binaries in binary_cache following their
path on device. But it doesn't work for native libs loaded
directly from apk. Because the path in binary_cache still
contains "!/", and simpleperf will try to find the apk instead
of the native lib.

To fix it, store binaries in path "build_id-filename" in
binary_cache. The build_id part can solve conflicts when
multiple binaries have the same filename.

Bug: 268298594
Test: run test.py --only-host-test
Change-Id: Icb53182ae4fb82656aba745e4b65e6dcbdaef227
4 files changed