如何读取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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
访问 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.