问题
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