You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Based on my investigation, MemPerf can run on Android platforms after some code modifications.
First, the rdtscp() implementation should be changed. Answers in https://stackoverflow.com/questions/40454157/is-there-an-equivalent-instructionto-rdtsc-in-arm/40455065 provide some solution ideas.
Second, the dlsym() function to help intercept malloc, free, pthread_create, locks, and system calls also works on Android. However, there are public and private .so files in android, and dlsym() can only read symbols from public libraries. The interception part will work fine if the related libraries are public, or using alternative ways (like binary instrumentation)
Third, Android also has perf_event_open() function to utilize PMU. The work https://android.googlesource.com/platform/prebuilts/simpleperf/+/refs/heads/ndk-r13-release/README.md is very similar to perf, and it is for Android platforms. It supports both "perf stat" (PMU counting) and "perf record" (PMU sampling) commands.
Fourth, Android does not support backtrace() function, so it should be replaced with alternative implementations. https://stackoverflow.com/questions/8115192/android-ndk-getting-the-backtrace shows some solutions.
The text was updated successfully, but these errors were encountered:
Based on my investigation, MemPerf can run on Android platforms after some code modifications.
First, the rdtscp() implementation should be changed. Answers in https://stackoverflow.com/questions/40454157/is-there-an-equivalent-instructionto-rdtsc-in-arm/40455065 provide some solution ideas.
Second, the dlsym() function to help intercept malloc, free, pthread_create, locks, and system calls also works on Android. However, there are public and private .so files in android, and dlsym() can only read symbols from public libraries. The interception part will work fine if the related libraries are public, or using alternative ways (like binary instrumentation)
Third, Android also has perf_event_open() function to utilize PMU. The work https://android.googlesource.com/platform/prebuilts/simpleperf/+/refs/heads/ndk-r13-release/README.md is very similar to perf, and it is for Android platforms. It supports both "perf stat" (PMU counting) and "perf record" (PMU sampling) commands.
Fourth, Android does not support backtrace() function, so it should be replaced with alternative implementations. https://stackoverflow.com/questions/8115192/android-ndk-getting-the-backtrace shows some solutions.
The text was updated successfully, but these errors were encountered: