Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android software NDK native c code profiling on actual Android phones

I am developing a rather large software on Android with a log native code, it's working now but having some performance issues.

I am hoping I can profile each module(function call) of the software for CPU cycles, memory usage, etc, on several real android phones. Is there a simple c library to do that?

I see people using oprofile, It seems to be a overkill for my case since that it is a system wild profiler, and it requires rebuild the kernel and system image.

As I have the full source code of my app, all I really need is a simple c library that I can embed in my code to do some profiling while the app runs several test cases.

BTW, what is the Linux way of doing this?

like image 1000
lennydizzy Avatar asked Dec 01 '10 20:12

lennydizzy


People also ask

What can I do with Android NDK?

The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.

What is ABI in Mobile?

Different Android devices use different CPUs, which in turn support different instruction sets. Each combination of CPU and instruction set has its own Application Binary Interface (ABI). An ABI includes the following information: The CPU instruction set (and extensions) that can be used.


1 Answers

I've had pretty decent results with android-ndk-profiler.

http://code.google.com/p/android-ndk-profiler/

Outputs /mnt/sdcard/gmon.out

like image 110
dwerner Avatar answered Sep 21 '22 13:09

dwerner