PERF STAT不计算内存负载,但计算内存存储 [英] PERF STAT does not count memory-loads but counts memory-stores

查看:267
本文介绍了PERF STAT不计算内存负载,但计算内存存储的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Linux内核: 4.10.0-20-generic(也在4.11.3上尝试过此操作)

Ubuntu: 17.04

我一直在尝试使用perf stat收集内存访问的统计信息.我可以收集内存存储的统计信息,但是内存负载的计数返回0值.

I have been trying to collect stats of memory-accesses using perf stat. I am able to collect stats for memory-stores but the count for memory-loads return me a 0 value.

以下是内存存储的详细信息:-

The below is the details for memory-stores :-

perf stat -e cpu/mem-stores/u ./libquantum_base.arnab 100
N = 100, 37 qubits required
Random seed: 33
Measured 3277 (0.200012), fractional approximation is 1/5.
Odd denominator, trying to expand by 2.
Possible period is 10.
100 = 4 * 25

 Performance counter stats for './libquantum_base.arnab 100':

       158,115,510      cpu/mem-stores/u                                            

       0.559922797 seconds time elapsed

对于内存负载,我得到一个0计数,如下所示:-

For memory-loads, I get a 0 count as can be seen below :-

perf stat -e cpu/mem-loads/u ./libquantum_base.arnab 100
N = 100, 37 qubits required
Random seed: 33
Measured 3277 (0.200012), fractional approximation is 1/5.
Odd denominator, trying to expand by 2.
Possible period is 10.
100 = 4 * 25

 Performance counter stats for './libquantum_base.arnab 100':

                 0      cpu/mem-loads/u                                             

       0.563806170 seconds time elapsed

我不明白为什么这算不上正确. 我应该以任何方式使用其他事件来获取正确的数据吗?

I cannot understand why this does not count properly. Should I use a different event in any way to get proper data ?

推荐答案

我已经使用Broadwell(CPU e5-2620)服务器计算机来收集以下所有事件.

I have used a Broadwell(CPU e5-2620) server machine to collect all of the below events.

要收集内存加载事件,我必须使用数字事件值.我基本上运行了以下命令-

To collect memory-load events, I had to use a numeric event value. I basically ran the below command -

./perf record -e "r81d0:u" -c 1 -d -m 128 ../../.././libquantum_base 20

此处,r81d0代表原始事件,用于对所有退出的指令中的内存负载"进行计数.可以理解,"u"表示用户空间.

Here r81d0 represents the raw event for counting "memory loads amongst all instructions retired". "u" as can be understood represents user-space.

另一方面,下面的命令

./perf record -e "r82d0:u" -c 1 -d -m 128 ../../.././libquantum_base 20

具有"r82d0:u"作为原始事件,表示在用户空间中退休的所有指令中的内存存储".

has "r82d0:u" as a raw event representing "memory stores amongst all instructions retired in userspace".

这篇关于PERF STAT不计算内存负载,但计算内存存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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