难道Android的(基于ARM)具备硬件性能计数器? [英] Does Android(on ARM) have the hardware performance counters?

查看:250
本文介绍了难道Android的(基于ARM)具备硬件性能计数器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以像Linux的英特尔处理器,我们有大量的硬件性能计数器的访问。像pviously $ P $,使用称为用户空间的软件 perfmon2 ,我能得到的高速缓存未命中率值, CPU拖延周期由于某种原因(例如,。L1高速缓存未命中)等。

So like in Linux on Intel processor, we have a large amount of hardware performance counters to access. Like previously, using a user-space software called perfmon2, I could get values of cache miss rate, CPU stalling cycles due to some reason(e.g,. L1 cache miss) and etc.

我的问题是,我们有这些东西在Android的?由于它是基于ARM的,我不认为我们有强劲的性能监控计数器的支持,我们在86,对不对?

My question is , do we have those stuff in Android? Since it's based on ARM, I do not think we have as strong performance monitor counter support as we have in x86, right?

推荐答案

ARM11和Cortex-A / R确实有硬件性能计数器。您可以检查在官方ARM网站此页面上:的 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka4237.html

ARM11 and Cortex-A/R do have hardware performance counters. You can check that on the official ARM website on this page: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka4237.html

由于Android是基于Linux的同时运行,则可以通过用户空间的软件通过PERF事件子系统的访问性能计数器。但是,你需要编写本地C code,其中包括perf_event.h,并​​使用Android NDK构建它。在您开始编写code,我建议你看一看这个项目:平台/外部/ Linux的工具 - PERF(的 https://android.googlesource.com/platform/external/linux-tools-perf/ ),这可能是你正在寻找什么。我不知道该从Java code允许这样做的直接任意选择。

Since Android is also running on top of Linux, you can access performance counters through user-space software via the "Perf Events" subsystem. However, you will need to write native C code, which includes "perf_event.h" and build it using the Android NDK. Before you start writing code, I suggest you take a look at this project: platform/external/linux-tools-perf (https://android.googlesource.com/platform/external/linux-tools-perf/), which may be exactly what you are looking for. I don't know about any alternatives which allow doing this directly from Java Code.

这篇关于难道Android的(基于ARM)具备硬件性能计数器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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