Reputation: 7168
I am developing an Android app which heavily uses NDK and also uses external shared libraries compiled from C++.
Those libraries contain various algorithms and I'd like to use profiling tools to boost performance of the code inside this library. Worth mentioning that I am building my C++ libraries with CMake.
Are there any tools for profiling that can be suitable for my case?
Edit:
Particularly, can I use android-ndk-profiler with my shared library?
Upvotes: 1
Views: 607
Reputation: 7168
I found two methods that can be used with native Android C++ libraries.
1) "Intrusive" profiling. Compile your code with -pg
and use android-ndk-profiler project to link everything up.
2) "Non-intrusive" way. Use fplutil android_ndk_perf
to run perf
on device. Follow their documentation for guidance.
1st way should work just about everywhere, while 2nd requires some support from Linux kernel and may not work properly on some devices.
Upvotes: 1