Tools to detect False Sharing in a C/C++ application
-
25-12-2020 - |
문제
Are there any tools that detect and report False Sharing for applications written in C or C++?
해결책
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.
다른 팁
Try the DRD (data race detection) module of valgrind.
From the manual it looks like it can be used to detect False sharing.
Perf("Performance Counters for Linux")
Commands:
sudo perf record -e cache-misses,anything_else_you_want ./your_program
sudo perf report
제휴하지 않습니다 StackOverflow