用于多线程环境的PMU [英] PMU for multi threaded environment
问题描述
我正计划为L1,L2,L3未命中分支预测未命中测量PMU计数器,我已阅读了相关的Intel文档,但不确定以下情况.请澄清一下吗?
I am planning to measure PMU counters for L1,L2,L3 misses branch prediction misses , I have read related Intel documents but i am unsure about the below scenarios.could some one please clarify ?
//assume PMU reset and PERFEVTSELx configurtion done above
ioctl(fd, IOCTL_MSR_CMDS, (long long)msr_start) //PMU start counters
my_program();
ioctl(fd, IOCTL_MSR_CMDS, (long long)msr_stop) ///PMU stop
//now reading PMU counters
1.如果我的进程在my_program()运行时被调度并调度到另一个内核,将会发生什么?
1.what will happen if my process is scheduled out when my_program() is running, and scheduled to another core?
2.如果进程被调度并再次调度回相同的内核,同时又有其他进程重置PMU计数器,将会发生什么?
2.what will happen if process scheduled out and schedule back to same core again, meanwhile some other process reset the PMU counters?
如何确保我们从PMU计数器中读取了正确的值?
How to make sure that we are reading the correct values from PMU counters.?
机器详细信息:具有Linux内核3.10.0-327.22.2.el7.x86_64的CentOS,该处理器使用3.40 GHz @Intel®Core™i7-3770 CPU供电
Machine details:CentOS with Linux kernel 3.10.0-327.22.2.el7.x86_64 , which is powered up with Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz
谢谢
推荐答案
我从某个英特尔论坛获得了答案,链接如下.
i got the answers from some Intel forum, the link is below.
https://软件. intel.com/en-us/forums/intel-moderncode-for-parallel-architectures/topic/673602
这篇关于用于多线程环境的PMU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!