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 h开发者_开发技巧ave access to the android source code. Please guide me.
Links:
1) dmtracedump doesn't work, HELP! 2) Android native code profiling 3) http://developer.android.com/guide/developing/debugging/debugging-tracing.htmlD:\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,
SSuman185But 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.
Use simpleperf
to profile native code on Android: https://android.googlesource.com/platform/system/extras/+/master/simpleperf/doc/README.md
精彩评论