Using PEBS and Linux Perf to Count the number of CPU cycles passed to execute X number of instructions

送分小仙女□ 提交于 2019-12-11 04:27:00

问题


I want to do something like this: After 100 million instructions have passed, query the Linux perf HW CPU cycles and record it in a file. I want to use this code to characterize the performance of applications/benchmark programs during different phases of program execution.

I have a hint that I need to setup Intel PEBS which overflows after 100 million instructions have passed and query the linux perf counters HW cpu cycles counter.

Any pointer on where to start and if someone has already done that. I want to do this in a low overhead manner. I will write the code in C/C++.

Regards...

来源:https://stackoverflow.com/questions/54674710/using-pebs-and-linux-perf-to-count-the-number-of-cpu-cycles-passed-to-execute-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!