Android的:是有分析本地code任何工具? [英] Android: is there any tool for profiling native code?
问题描述
我只找到了一个分析工具 - <一个href=\"http://$c$c.google.com/p/android-ndk-profiler/\">http://$c$c.google.com/p/android-ndk-profiler/.是不是能够得到它到目前为止的工作,所以我不知道是否有可用的其他工具。
我需要一个物理设备上的配置文件,因为我的应用程序甚至不上仿真器。
I have only found one profiling tool - http://code.google.com/p/android-ndk-profiler/. Wasn't able to get it working so far, so I wonder if there are other tools available. I need to profile on a physical device, as my application doesn't even work on emulator.
推荐答案
这是不容易使Android的NDK探查工作。这里需要遵循的步骤 彻底。
It is not easy to make the Android-NDK profiler work. You need to follow the steps here thoroughly.
下面是一些提示,导致我的成功:
Here are some tips that led me to success:
- 确保您的android.mk是正确的,你导出NDK_MODULE_PATH。
-
使用正确的以下功能
- Make sure your android.mk is correct and that you export the NDK_MODULE_PATH.
Use correctly the following functions
monstartup(your_lib.so);
monstartup("your_lib.so");
moncleanup();
moncleanup();
如果生成是gmon.out现在你需要从设备拉,而不是在任何地方你的电脑。对我来说,只有当我去到应用程序的文件夹(JNI,OBJ,资源和其他文件夹)的作品和我做的:
If the gmon.out is generated now you need to pull it from the device, but not to anywhere in your PC. For me it only works if I go to the application's folder (where jni, obj, res and other folders are) and I do:
控制台$ 亚行拉SD卡/是gmon.out
console$ adb pull sdcard/gmon.out
然后运行gprof的。尝试将所有版本在你的NDK工具链。对我来说,只有一个工作,这一个:
Then run gprof. Try will all the versions in your NDK toolchains. For me only one worked, this one:
控制台$ ~/Libraries/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/$p$pbuilt/linux-x86_64/bin/arm-linux-androideabi-gprof OBJ /本地/ armeabi-V7A / libxxxx.so> profile.txt
console$ ~/Libraries/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gprof obj/local/armeabi-v7a/libxxxx.so > profile.txt
这篇关于Android的:是有分析本地code任何工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!