Tools to detect False Sharing in a C/C++ application

ぐ巨炮叔叔 提交于 2019-12-05 18:31:05

问题


Are there any tools that detect and report False Sharing for applications written in C or C++?


回答1:


Try Sheriff and Predator. Sheriff is at https://github.com/plasma-umass/sheriff, while Predator is at https://github.com/plasma-umass/Predator. Predator is a compiler-based approach that you have to recompile your program using a new LLVM compiler. It is the most exhaustive detection tool up to now. Sheriff is library but it can only detect false sharing if you are using pthreads library.




回答2:


Try the DRD (data race detection) module of valgrind.

From the manual it looks like it can be used to detect False sharing.




回答3:


Perf("Performance Counters for Linux")

Commands:

sudo perf record -e cache-misses,anything_else_you_want ./your_program 
sudo perf report 


来源:https://stackoverflow.com/questions/7079950/tools-to-detect-false-sharing-in-a-c-c-application

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