How to profile "native code" in Android?

Not able to profile android native code

  • I am trying to optimise native code. I tried using Debug.startMethodTracing() and Debug.stopMethodTracing(). But its profiling only java functions, its not profiling the native code. The native call that we do from java code is just displayed for that time, the internal native calls are not being displayed. I built the native library in debug mode, even then i am not able to profile the native code. In stackoverflow i got these links, but these are also not much useful for me, please help me in profiling native code. I am working on the release phone for app development on Android. So, i dont have access to the android source code. Please guide me. Links: 1) http://stackoverflow.com/questions/4364833/dmtracedump-doesnt-work-help 2) http://stackoverflow.com/questions/3440744/android-native-code-profiling 3) http://developer.android.com/guide/developing/debugging/debugging-tracing.html D:\Profiling>dmtracedump -o D:\Profiling\EvrcEncoderProfiling.trace ERROR: unable to read 42170 bytes from trace file D:\Profiling>traceview D:\Profiling\EvrcEncoderProfiling.trace D:\Profiling> Traceview is working but dmtracedump is not working. Thanks & Regards, SSuman185

  • Answer:

    But its profiling only java functions, its not profiling the native code. Correct. That is all Traceview can do, since the trace files will only have Dalvik information. Traceview is working but dmtracedump is not working. While I do not know why it is not working for you (I have never used it), it will not have any more insight into your native code than will Traceview. AFAIK, you will need to profile your native code the old-fashioned way: by collecting and logging times.

Suman at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.