How to measure mispredictions for a single branch on Linux?

匆匆过客 提交于 2019-12-04 10:18:36

You can sample on the branch-misses event:

sudo perf record -e branch-misses <yourapp>

and then report it (and even selecting the function you're interested in):

sudo perf report -n --symbols=<yourfunction>

There you can access the annotated code and get some statistics for a given branch. Or directly annotate it with the perf command with --symbol option.

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