【问题标题】:What does +-# after percent of cache misses mean in perf stat?在 perf stat 中,缓存未命中百分比后的 +-# 是什么意思?
【发布时间】:2016-04-22 20:02:59
【问题描述】:

我使用了perf stat --repeat 100 -e cache-references,cache- misses,cycles,instructions,branches,faults,migrations ./avx2ADD 命令,输出如下。当缓存未命中百分比等于4.010 % 时,+- 8.93% for cache-misses 是什么意思?

 32,425      cache-references                                       ( +-  0.54% )
  1,300      cache-misses         #    4.010 % of all cache refs    ( +-  8.93% )
538,839      cycles                                                 ( +-  0.28% )
520,056      instructions         #    0.97  insns per cycle        ( +-  0.22% )
 98,720      branches                                               ( +-  0.20% )
     95      faults                                                 ( +-  0.12% )
      0      migrations                                             ( +- 70.35% )

【问题讨论】:

    标签: caching perf


    【解决方案1】:

    +- 8.93% 部分在手册页中有描述:

    -r, --repeat=

    重复命令并打印 average + stddev(最大值:100)。 0 表示永远。

    如果您不确定stddev 的缩写是什么意思,它是Standard Deviation(是的,也可能有更详细的手册页)。简而言之,结果与所有重复测量的差异有多大。值越小越好,但如果你有这么小的问题(500k 指令),偏差会更大,因为缓存未命中可能是不确定的。

    百分比4.010 % 表示上述描述中的平均值

    【讨论】:

    • 故障数量呢?
    • 由于某种原因,我的 CPU 上没有此事件。但是是同一个逻辑。平均为 95 次故障,标准差为 0.12%(相当规律)。
    • 是否依赖缓存中的别名问题?
    • 没有。 AVX 需要对齐的向量。如果您直接使用 inrinsics,则会出现错误对齐数据的段错误,AFAIK。
    • 对齐到 32 字节。
    猜你喜欢
    • 2012-09-18
    • 2018-10-23
    • 2015-02-18
    • 2018-01-28
    • 1970-01-01
    • 2013-01-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多