Saturday, April 30, 2011

Android NDK Profiler Example

I've added an example to the android-ndk-profiler project based on the native-activity from Google's Android SDK. As Google Code doesn't let you mix'n'match licences, and importing a bunch of random code into my SVN seemed a bit crap, I've not included the original source in the repository.

What I have done is supply a patch and a script to copy the code from your NDK installation, patch it up to use profiling, update the build scripts and then build the example. You'll need to have the "patch" program installed to get this working, or apply the changes manually.

Since this is Android 2.3 only, I've only been able to test it on the emulator. Also the emulator doesn't like armeabi-v7a, so that remains completely untested - I'd stick to using APP_ABI := armeabi for profiling for now.

Hopefully this'll clear up any misunderstandings like those mentioned in the comments on the last post I made on the subject. Full details are on this wiki page about getting the example working.

1 comment:

  1. Hello,
    I tested your example from android-ndk-profiler-3.1-src.tar.gz., but I dont have any time information in result. Only calls counter.

    My result:
    Flat profile:

    Each sample counts as 0.002 seconds.
    no time accumulated

    % cumulative self self total
    time seconds seconds calls Ts/call Ts/call name
    0.00 0.00 0.00 1 0.00 0.00 do_dummy_call_1
    0.00 0.00 0.00 1 0.00 0.00 do_dummy_call_2

    Configuration:
    armeabi
    android-ndk-r5c

    Tested on device HTC 2.3.4 and emulator 2.1-update1.

    Do you have any idea, where can be problem?
    I think native-activity.patch have resolve information from SVN.

    Thanks for your project and help.

    MB

    ReplyDelete

Note: only a member of this blog may post a comment.