NDK profiling showing “.so has no symbols”

狂风中的少年 提交于 2019-12-10 04:27:36

问题


I am doing NDK profiling for my project using android-ndk-profiler-3.1. I have made changes in Android.mk as follows...

LOCAL_PATH := $(call my-dir)
 -include android-ndk-profiler.mk
include $(CLEAR_VARS)

# Module name -------------------------------------------------------
LOCAL_CFLAGS += -O3 
TARGET_ARCH_ABI :=armeabi
LOCAL_CFLAGS := -pg
LOCAL_STATIC_LIBRARIES := andprof
LOCAL_LDLIBS += -llog
LOCAL_MODULE := libitv

include $(BUILD_SHARED_LIBRARY)

Application.mk is as follows...

APP_ABI := armeabi
APP_PLATFORM := android-10

I have called monstartup("itv.so"); function in the beginning of the native code and moncleanup(); function in the stop method. And gmon.out file is created successfully.And then I have pasted gmon.out in D:\android\android-ndk-r6-windows\android-ndk-r6\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin directory.

But when I am trying to read gmon.out using the following command...

D:\android\android-ndk-r6-windows\android-ndk-r6\toolchains\arm-linux-androideab
i-4.4.3\prebuilt\windows\bin>arm-linux-androideabi-gprof D:\InternetTV_FD_Canvas
\libs\armeabi\libitv.so > out.txt

This Error is showing...

arm-linux-androideabi-gprof: file `D:\InternetTV_FD_Canvas\libs\armeabi\libitv.so'
 has no symbols

I am not able to make out why this error is coming even I have done everything fine.

Can anybody please help me.

Any help will be appreciated.

Thanks in Advance.


回答1:


The NDK build process creates 2 libraries, one with symbols and one stripped without. You install the stripped, symbol-less library in your APK, but you need to use the unstripped version with gprof. If you run:

arm-linux-androideabi-gprof D:\InternetTV_FD_Canvas\obj\local\armeabi\libitv.so

... then that should be the correct library.



来源:https://stackoverflow.com/questions/9923896/ndk-profiling-showing-so-has-no-symbols

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!