google / fplutil

fplutil is a set of small libraries and tools that can be useful when developing applications for Android and other platforms.
http://google.github.io/fplutil
Apache License 2.0
333 stars 49 forks source link

Unable to run android_ndk_perf on Nexus 9 #5

Open dturner opened 8 years ago

dturner commented 8 years ago

Following the instructions here: https://google.github.io/fplutil/android_ndk_perf.html. I run the following command:

cd liquidfun/Box2D/Testbed android_ndk_perf --apk bin/testbed-debug.apk record -o output/perf.data

This produces the following error:

WARNING: Nexus 9 is not in the list of supported devices. It is likely that the performance counters don't work so you may need to try a different device.

run-as: exec failed for /data/local/tmp/perf: Permission denied 243 chmod: /data/data/com.google.fpl.liquidfun.testbed/perf.data: No such file or directory 1 0 Unable to make /data/data/com.google.fpl.liquidfun.testbed/perf.data readable.

stewartmiles commented 8 years ago

Hi Don, are you sure the perf binary was copied to the device? It looks like adb push failed.

On Tue, Apr 12, 2016 at 2:24 PM, Don Turner notifications@github.com wrote:

Following the instructions here: https://google.github.io/fplutil/android_ndk_perf.html. I run the following command:

cd liquidfun/Box2D/Testbed android_ndk_perf --apk bin/testbed-debug.apk record -o output/perf.data

This produces the following error:

WARNING: Nexus 9 is not in the list of supported devices. It is likely that the performance counters don't work so you may need to try a different device.

run-as: exec failed for /data/local/tmp/perf: Permission denied 243 chmod: /data/data/com.google.fpl.liquidfun.testbed/perf.data: No such file or directory 1 0 Unable to make /data/data/com.google.fpl.liquidfun.testbed/perf.data readable.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/google/fplutil/issues/5

dturner commented 8 years ago

Running android_ndk_perf with --verbose I can see that it's the following command which fails:

/usr/local/bin/adb "shell" "run-as com.google.fpl.liquidfun.testbed /data/local/tmp/perf"

With the error: run-as: exec failed for /data/local/tmp/perf: Permission denied

This is because whilst /data/local/tmp/perf is world executable, /data/local/tmp is not world readable (/data is readable only by system).

dturner commented 8 years ago

I did find that you can do adb shell cp /data/local/tmp/perf /data/data/com.google.fpl.liquidfun.testbed/perf in order to copy the perf binary into the package folder. It can then be executed using run-as from there.

stewartmiles commented 8 years ago

I have an internal patch for this, haven't tested all command but in general it looks like perf may have issues with Android N anyway.