diff options
author | Kostya Serebryany <kcc@google.com> | 2016-04-18 21:28:37 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-04-18 21:28:37 +0000 |
commit | 6453786b2644433650cb091a480bbad63119c767 (patch) | |
tree | 39304efa45bd0ac2f9ceecc8a15d16505561de73 /clang | |
parent | e2bd2dcc9db05dabb5888fc566618795dd6e974c (diff) | |
download | bcm5719-llvm-6453786b2644433650cb091a480bbad63119c767.tar.gz bcm5719-llvm-6453786b2644433650cb091a480bbad63119c767.zip |
[sanitizer-coverage] better docs for -fsanitize-coverage=trace-bb
llvm-svn: 266672
Diffstat (limited to 'clang')
-rw-r--r-- | clang/docs/SanitizerCoverage.rst | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/clang/docs/SanitizerCoverage.rst b/clang/docs/SanitizerCoverage.rst index 024511cf51c..d2dde000273 100644 --- a/clang/docs/SanitizerCoverage.rst +++ b/clang/docs/SanitizerCoverage.rst @@ -286,10 +286,26 @@ These counters may also be used for in-process coverage-guided fuzzers. See Tracing basic blocks ==================== -An *experimental* feature to support basic block (or edge) tracing. +Experimental support for basic block (or edge) tracing. With ``-fsanitize-coverage=trace-bb`` the compiler will insert ``__sanitizer_cov_trace_basic_block(s32 *id)`` before every function, basic block, or edge (depending on the value of ``-fsanitize-coverage=[func,bb,edge]``). +Example: + +.. code-block:: console + + % clang -g -fsanitize=address -fsanitize-coverage=edge,trace-bb foo.cc + % ASAN_OPTIONS=coverage=1 ./a.out + +This will produce two files after the process exit: +`trace-points.PID.sancov` and `trace-events.PID.sancov`. +The first file will contain a textual description of all the instrumented points in the program +in the form that you can feed into llvm-symbolizer (e.g. `a.out 0x4dca89`), one per line. +The second file will contain the actual execution trace as a sequence of 4-byte integers +-- these integers are the indices into the array of instrumented points (the first file). + +Basic block tracing is currently supported only for single-threaded applications. + Tracing PCs =========== |