美文网首页
perf查看CPU相关信息

perf查看CPU相关信息

作者: pandazhong | 来源:发表于2018-10-25 21:12 被阅读0次

    lscpu:查看CPU相关信息

    perf top -p 70257 -e L1-dcache-load-misses   查看指定进程进程的L1缓存的数据misses

    perf top -p 70257 -e L1-dcache-loads  查看制定进程的L1缓存数据的load

    perf stat -e instructions -e cache-references -e cache-misses -e L1-dcache-loads -e L1-dcache-load-misses -e L1-dcache-stores -e L1-dcache-store-misses -e LLC-loads -e LLC-load-misses -e LLC-prefetches -e cycles -e cs ./cacheline_unaligned

    perf stat -p 70257

    打印如下:

    其中:cycles指花费了多少指令周期,instructions值每个指令周期执行的指令数,branches指有多少个分支预测,branch-misses指分支预测错误的次数。task-clock代表执行了多少毫秒,使用了多少个CPU单元,LLC代表last level cache,指的是L2/L3。

    相关文章

      网友评论

          本文标题:perf查看CPU相关信息

          本文链接:https://www.haomeiwen.com/subject/hjzctqtx.html