The Instrumentation Modes of ctc

With the different instrumentation modes for coverage and for timing, different structures of the source code are instrumented.

For each source file the instrumentation mode can be selected independently of other instrumented source files. The instrumentation mode determines how much probes are inserted to the source file and thus how much information is collected when the instrumented program is executed.

For structural code coverage there are function, decision and multicondition instrumentation modes, and one of them is always selected. All other coverage measures are derived when reports are generated after the test runs.

Timing instrumentation has submodes for inclusive and exclusive timing. Selecting timing instrumentation is optional.

The probes collect the execution information into counter arrays generated by ctc. There are several types of counters:

  • START_COUNTERS: This counter array keeps track how many times each function has been called.
  • JUMP_COUNTERS: This is a counter array, where one element tells "how many times the pertinent code location, like ‘goto’, ‘return’, etc., has been visited".
  • DECISION_COUNTERS: This is a pair of counter arrays that are used to keep track how many times a complete branching decision has been evaluated to true and to false.
  • MULTICONDITION_COUNTERS: This is a counter array, which is used to keep track how many times each individual combination of a condition expression containing && and || operators has been evaluated.
  • TIMER_COUNTERS: This is a pair of counter arrays used to keep track of subprogram execution total and maximum timing (execution cost).

You can see with ctcpost option -L the sizes of these arrays.