How is "IPC" calculated by perf stat?

271 Views Asked by At

I have collected perf data with the following command:

sudo perf stat -e instructions,cycles,task-clock,cpu-clock -a -I 1000 -x , -G /mygroup

part of the output is shown as following:

39.050051176,51077380951,,instructions,/mygroup,11821768340,94.10,1.46,insn per cycle
39.050051176,37099680080,,cycles,/mygroup,11816912757,94.06,2.951,GHz
39.050051176,13375.35,msec,task-clock,/mygroup,12556528775,99.95,13.375,CPUs utilized
39.050051176,13371.12,msec,cpu-clock,/mygroup,12556453290,99.95,13.371,CPUs utilized

I wonder how the "1.46,insn per cycle" is calculated?

If final count is used: 51077380951 / 37099680080 = 1.377

If raw count is used: (51077380951*0.9410) / (37099680080*0.9406) = 1.377

Neither matches with the 1.46 calculated by perf.

0

There are 0 best solutions below