The Behavior of ctcdiff

ctcdiff compares two Execution Profile Listings source file by source file. The coverage differences are marked based on the second Execution Profile Listing.

Results at probe level

Assume we have in profileA.txt two lines
0          5 -    20   if (x > 5)
0            -    22     return 1
and in profileB.txt the corresponding lines
7          0 -   20   if (x > 5)
7                22     return 1
Assuming the function containing this code did not change and the two reports are inputted to ctcdiff in the following order
ctcdiff –i1 profileA.txt –i2 profileB.txt –p output.txt
In this case, in output.txt these lines appear as
7^         0v-   20   if (x > 5)
7^               22     return 1

In the example above, there are basically three points where the coverage can become better, worse, or remain the same (same in the meaning: covered yes/ no). Coverage improvement is marked with character "^", coverage decline with character "v". Here we see two improvements (^) and one decline (v) in coverage.

If the profile listings are given the other way around
ctcdiff –i1 profileB.txt –i2 profileA.txt –p output.txt
the result is
0v         5^-    20   if (x > 5)
0v           -    22     return 1
Here we see two coverage declines (v) and one improvement (^).

Results at summary levels

At summary levels (per function, per file and overall), the report shows the initial structural coverage (how many probes covered in 1st listing), the amount of improvements (covered in second listing but not in first one), the amount of coverage decline (not covered in second listing but covered in first one).

For example, the compared summary for function foo
***TER   22 % ([8 + 5 - 2]  11/ 50) of FUNCTION foo()
means that for foo
  • Initially, based on first listing, 8 measurement points were covered.
  • Then, based on second listing, coverage was obtained in 5 new points not covered before.
  • Simultaneously, coverage was lost for 2 counting points.
This results in 11 covered counting points from the second listing. We can also calculate that there are 8 – 2 = 6 common points where both listings showed coverage. If the two test runs would be merged, there would be 8 + 5 = 13 points that are covered.