From 90a3a2e1c767428f172951adabc741cb9d36b6e5 Mon Sep 17 00:00:00 2001 From: ev-john <56849582+ev-john@users.noreply.github.com> Date: Sat, 24 Oct 2020 13:13:51 +0100 Subject: [PATCH] gcov: add page (#4723) --- pages/linux/gcov.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pages/linux/gcov.md diff --git a/pages/linux/gcov.md b/pages/linux/gcov.md new file mode 100644 index 000000000..c03c9d059 --- /dev/null +++ b/pages/linux/gcov.md @@ -0,0 +1,29 @@ +# 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: . + +- Generate a coverage report named `file.cpp.gcov`: + +`gcov {{path/to/file.cpp}}` + +- Write individual execution counts for every basic block: + +`gcov --all-blocks {{path/to/file.cpp}}` + +- Write branch frequencies to the output file and print summary information to `stdout` as a percentage: + +`gcov --branch-probabilities {{path/to/file.cpp}}` + +- Write branch frequencies as the number of branches taken, rather than the percentage: + +`gcov --branch-counts {{path/to/file.cpp}}` + +- Do not create a `gcov` output file: + +`gcov --no-output {{path/to/file.cpp}}` + +- Write file level as well as function level summaries: + +`gcov --function-summaries {{path/to/file.cpp}}`