From 9e705b0e60d2796a5d050d4658edc0060e98eb41 Mon Sep 17 00:00:00 2001 From: Sergey Matveev <earthdok@google.com> Date: Wed, 6 May 2015 21:09:00 +0000 Subject: [PATCH] [docs] Update SanitizerCoverage docs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236641 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/SanitizerCoverage.rst | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/SanitizerCoverage.rst b/docs/SanitizerCoverage.rst index a2d60ffdaf1..ebc637c58e1 100644 --- a/docs/SanitizerCoverage.rst +++ b/docs/SanitizerCoverage.rst @@ -96,15 +96,21 @@ numbers: How good is the coverage? ========================= -If you want to know what PCs are still not covered, you can get the list of all -instrumented PCs and then subtract all covered PCs from it. You can use -``objdump`` to get all instrumented PCs: +It is possible to find out which PCs are not covered, by subtracting the covered +set from the set of all instrumented PCs. The latter can be obtained by listing +all callsites of ``__sanitizer_cov()`` in the binary. On Linux, ``sancov.py`` +can do this for you. Just supply the path to binary and a list of covered PCs: .. code-block:: console - % objdump -d ./your-binary | grep '__sanitizer_cov\>' | grep -o "^ *[0-9a-f]\+" - -TODO: implement scripts for doing this. + % sancov.py print a.out.12345.sancov > covered.txt + sancov.py: read 2 64-bit PCs from a.out.12345.sancov + sancov.py: 1 file merged; 2 PCs total + % sancov.py missing a.out < covered.txt + sancov.py: found 3 instrumented PCs in a.out + sancov.py: read 2 PCs from stdin + sancov.py: 1 PCs missing from coverage + 0x4cc61c Edge coverage ============= -- GitLab