2015-02-06 76 views
2

我读的perf list手册,并找到memory load/store以下PMU事件定义:“cpu/mem-loads/pp”和“cpu/mem-loads /”有什么区别?

mem-loads OR cpu/mem-loads/      [Kernel PMU event] 
mem-stores OR cpu/mem-stores/      [Kernel PMU event] 

但我总是读perf脚本,使用“cpu/mem-loads/pp”而不是“cpu/mem-loads/”。他们有什么区别?它们是一样的吗?我试图谷歌的答案,但无法找到解释。

回答

3

p修饰符代表precise level进行采样时,它用于指示您容忍的滑块:可以从生成样本的有效指令中报告多少指令。 pp表示SAMPLE_IP被要求有0滑移。换句话说,当你进行内存访问抽样时,你想要确切地知道哪个指令生成访问。

man perf list

p - precise level 
.... 
     The p modifier can be used for specifying how precise the instruction address should be. The p modifier can be specified multiple times: 

      0 - SAMPLE_IP can have arbitrary skid 
      1 - SAMPLE_IP must have constant skid 
      2 - SAMPLE_IP requested to have 0 skid 
      3 - SAMPLE_IP must have 0 skid 

     For Intel systems precise event sampling is implemented with PEBS which supports up to precise-level 2. 

     On AMD systems it is implemented using IBS (up to precise-level 2). The precise modifier works with event types 0x76 (cpu-cycles, CPU clocks not halted) and 0xC1 (micro-ops 
     retired). Both events map to IBS execution sampling (IBS op) with the IBS Op Counter Control bit (IbsOpCntCtl) set respectively (see AMD64 Architecture Programmer’s Manual Volume 
     2: System Programming, 13.3 Instruction-Based Sampling). Examples to use IBS: 

      perf record -a -e cpu-cycles:p ... # use ibs op counting cycles 
      perf record -a -e r076:p ...   # same as -e cpu-cycles:p 
      perf record -a -e r0C1:p ...   # use ibs op counting micro-ops