Skip to content

Commit c77978e

Browse files
committed
Document block instrumentation
1 parent 370a2e6 commit c77978e

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

doc/gnatcov/src_traces.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,25 @@ Guarded expression coverage is only available for the Ada language.
669669
For implementation reasons, it is only available starting from version 2022 of
670670
the language.
671671

672+
.. _instr-opti:
673+
674+
Optimizing the execution of instrumented programs
675+
=================================================
676+
677+
To monitor the execution of statement obligations, gnatcov instruments the code
678+
which results in an execution overhead.
679+
680+
To mitigate the performance impact, one can use the
681+
:cmd-option:`--instrument-block switch`. Instead of instrumenting for the
682+
execution of one statement, gnatcov instrument the code for the execution of a
683+
block of statements, greatly reducing the execution overhead. The coverage
684+
report is left unchanged, only the way coverage obligation are discarded is.
685+
686+
It is important to note that this could result in *false negatives* (i.e.
687+
covered code reported as uncovered) when exceptions are used as a control flow
688+
mechanism, and do not necessarily signal an abnormal termination of the program.
689+
The tool will never report false positives (uncovered code reported as covered).
690+
672691
.. _instr-build:
673692

674693
Building instrumented components

0 commit comments

Comments
 (0)