Android 软件 NDK 原生 c 代码在实际 Android 手机上的分析 [英] Android software NDK native c code profiling on actual Android phones

查看:17
本文介绍了Android 软件 NDK 原生 c 代码在实际 Android 手机上的分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用日志原生代码在 Android 上开发一个相当大的软件,它现在可以运行,但存在一些性能问题.

I am developing a rather large software on Android with a log native code, it's working now but having some performance issues.

我希望我可以在几款真正的安卓手机上分析软件的每个模块(函数调用)的 CPU 周期、内存使用情况等.是否有一个简单的 c 库可以做到这一点?

I am hoping I can profile each module(function call) of the software for CPU cycles, memory usage, etc, on several real android phones. Is there a simple c library to do that?

我看到有人在使用 oprofile,这对我来说似乎有点过头了,因为它是一个系统狂野的分析器,它需要重建内核和系统映像.

I see people using oprofile, It seems to be a overkill for my case since that it is a system wild profiler, and it requires rebuild the kernel and system image.

由于我拥有我的应用程序的完整源代码,我真正需要的是一个简单的 c 库,我可以将它嵌入到我的代码中,以便在应用程序运行多个测试用例时进行一些分析.

As I have the full source code of my app, all I really need is a simple c library that I can embed in my code to do some profiling while the app runs several test cases.

顺便说一句,Linux 的做法是什么?

BTW, what is the Linux way of doing this?

推荐答案

我用 android-ndk-profiler 取得了相当不错的结果.

I've had pretty decent results with android-ndk-profiler.

http://code.google.com/p/android-ndk-profiler/

输出/mnt/sdcard/gmon.out

Outputs /mnt/sdcard/gmon.out

这篇关于Android 软件 NDK 原生 c 代码在实际 Android 手机上的分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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