配置文件共享库Android NDK应用程序 [英] Profile shared library Android NDK application

查看:339
本文介绍了配置文件共享库Android NDK应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Android应用程序,它大量使用NDK并使用从C ++编译的外部共享库。

I am developing an Android app which heavily uses NDK and also uses external shared libraries compiled from C++.

这些库包含各种算法,我想使用profiling工具来提高这个库中的代码性能。值得一提的是,我正在用CMake构建我的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?

编辑:

特别是,我可以使用

Particularly, can I use android-ndk-profiler with my shared library?

推荐答案

1)侵入式概要分析。使用 -pg 编译您的代码,并使用android-ndk-profiler工程链接一切。

1) "Intrusive" profiling. Compile your code with -pg and use android-ndk-profiler project to link everything up.

2)非侵入的方式。使用 fplutil android_ndk_perf 在设备上运行 perf

2) "Non-intrusive" way. Use fplutil android_ndk_perf to run perf on device. Follow their documentation for guidance.

第一种方式应该可以在任何地方工作,第二种方式需要Linux内核的一些支持,并且可能无法在某些设备上正常工作。

1st way should work just about everywhere, while 2nd requires some support from Linux kernel and may not work properly on some devices.

这篇关于配置文件共享库Android NDK应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆