Write individual execution counts for every basic block

gcov

  • Code coverage analysis and profiling tool that discovers untested parts of a program.
    Also displays a copy of source code annotated with execution frequencies of code segments.
    More information: <https://gcc.gnu.org/onlinedocs/gcc/Invoking-Gcov.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

gcov --all-blocks {{path/to/file.cpp}}

click the source code to copy install gcov on any operating system with command-not-found.com