Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NDK profiling showing ".so has no symbols"

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.

like image 342
geeta Avatar asked Mar 29 '12 10:03

geeta


1 Answers

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.

like image 83
richq Avatar answered Sep 21 '22 22:09

richq