如何在 Android (ARM) 中读取 L2 缓存命中/未命中率? [英] how to read L2 cache hit/miss rate in Android (ARM)?

查看:36
本文介绍了如何在 Android (ARM) 中读取 L2 缓存命中/未命中率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了一种使用 http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka4237.html.我也想读取 L2 性能计数器.有没有人知道如何用ARM汇编或像Java这样的更高级别来测量L2缓存命中率?

I found a way to read L1(data and instruction) cache using http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka4237.html. I want to read L2 performance counters too. Is there anyone who knows how to measure L2 cache hit rate possibly with ARM assembly or in higher level like Java?

推荐答案

访问 L2 的性能数据取决于 L2 控制器.我不知道有多少不同的,但对于当前的 A9 平台,PL310 非常普遍,并且具有可以捕获请求和命中的事件计数器(http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0246a/index.html).尽管访问这些计数器可能很困难.如果幸运的话,内核可能会为这些寄存器提供一个接口,但很可能不是这样,并且它们不能从用户空间访问.在这种情况下,您必须为您的平台找到内存映射并编写内核模块或类似的东西.

Accessing performance data for the L2 is dependent on the L2-controller. I don't know how many different ones there are, but for current A9 platforms the PL310 is pretty common and features event counters which can capture requests and hits (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0246a/index.html ). Though accessing those counters might be difficult. If you're lucky the kernel might offer an interface to those registers, but it's likely that not and that they aren't accessible from user space. In that case you would have to find the memory map for your platform and write a kernel module or something like that.

这篇关于如何在 Android (ARM) 中读取 L2 缓存命中/未命中率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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