PMUinUse always fails

PMUinUse always fails

I have written a simple program where I get a PCM instance and call 'program()'.

PCM* m = PCM::getInstance();
std::cout << m->program() << std::endl;

My output is always 2 (PMUBusy).  I see these warnings outputted as well:

WARNING: Core 0 IA32_PERFEVTSEL0_ADDR are not zeroed 5439548
WARNING: Core 0 IA32_PERFEVTSEL0_ADDR are not zeroed 5439548

Im not entirely sure what this indicates to me.  I *think* it means that there are more than the limited number of allowed processes monitoring the PCM; though, I don't think any other process is running that is using the PCM.

4 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项
Roman Dementiev (Intel)的头像

Hi John,

besides PCM there can be other programs using or used and not cleared hardware PMU (Performance Monitoring Unit) upon exit, that is why you see these messages. Do you run Linux or Windows? You can enfore clearing up PMU with the pcm.x/exe utility. After that try to run your code again.

Thanks,
Roman

Hi Roman,

Thanks for the quick response; that did fix things for me. I am running Linux.

After a few runs I noticed my program, as well as the pcm.x utility, started returning -1 for instructions per CPU cycle and 0 for the Frequency. I notice that the Number of PCM instances climbs if I happen to 'hard kill' my program, which results in me not calling cleanup on my PCM instance. I don't know if this is the cause of these values or if there is a way to clean this up.

Any Thoughts?

Roman Dementiev (Intel)的头像

Hi John,

this might be the reason. To call PCM cleanup on a normal kill or Ctrl-C or program exit you can install a handler using the "signal" system call. Please see cpucounterstest.cpp for an example. To manually reset the global PCM instance counter (in case of PCM hard kill) you can try reboot the system or do "rm /dev/shm/sem.*Intel*PCM*".

Thanks,
Roman

登陆并发表评论。