【问题标题】:the raw encoding of pre-defined events in perfperf 中预定义事件的原始编码
【发布时间】:2016-08-31 05:22:27
【问题描述】:

有没有办法找出 perf(Linux 分析工具)中预定义事件的原始编码?

例如,我们使用perf stat -e instructions userexecutable 来统计指令数。 perf 能否显示事件“指令”的原始编码?

【问题讨论】:

    标签: linux profiling perf


    【解决方案1】:

    您可以查看位于/sys/devices/cpu/events/ 下的文件

    【讨论】:

      【解决方案2】:

      我不会知道的。请注意,这些事件是特定于处理器的。例如,在 Power8 上,指令由结构 (libpfm4 source) 引用:

      [ POWER8_PME_PM_INST_CMPL ] = {
          .pme_name = "PM_INST_CMPL",
          .pme_code = 0x2,
          .pme_short_desc = "Number of PowerPC Instructions that completed.",
          .pme_long_desc = "PPC Instructions Finished (completed).",
      },
      

      指令计数可以使用

      perf stat -e r2 userexecutable
      

      对于你的处理器,会有类似的转换,但我不知道有什么更少的手动方式。

      【讨论】:

        猜你喜欢
        • 2013-04-10
        • 2020-05-17
        • 2020-12-18
        • 1970-01-01
        • 1970-01-01
        • 2020-06-01
        • 2021-12-15
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多