| 1 |
80.00% of 5 branches executed in file tmp.c |
|---|
| 2 |
80.00% of 5 branches taken at least once in file tmp.c |
|---|
| 3 |
50.00% of 2 calls executed in file tmp.c |
|---|
| 4 |
Creating tmp.c.gcov. |
|---|
| 5 |
.Ed |
|---|
| 6 |
.Pp |
|---|
| 7 |
Here is a sample of a resulting |
|---|
| 8 |
.Pa tmp.c.gcov |
|---|
| 9 |
file: |
|---|
| 10 |
.Bd -unfilled -offset indent |
|---|
| 11 |
main() |
|---|
| 12 |
{ |
|---|
| 13 |
1 int i, total; |
|---|
| 14 |
|
|---|
| 15 |
1 total = 0; |
|---|
| 16 |
|
|---|
| 17 |
11 for (i = 0; i < 10; i++) |
|---|
| 18 |
branch 0 taken = 91% |
|---|
| 19 |
branch 1 taken = 100% |
|---|
| 20 |
branch 2 taken = 100% |
|---|
| 21 |
10 total += i; |
|---|
| 22 |
|
|---|
| 23 |
1 if (total != 45) |
|---|
| 24 |
branch 0 taken = 100% |
|---|
| 25 |
###### printf ("Failure\\\\n"); |
|---|
| 26 |
call 0 never executed |
|---|
| 27 |
branch 1 never executed |
|---|
| 28 |
else |
|---|
| 29 |
1 printf ("Success\\\\n"); |
|---|
| 30 |
call 0 returns = 100% |
|---|
| 31 |
1 } |
|---|
| 32 |
.Ed |
|---|
| 33 |
.Pp |
|---|
| 34 |
For each basic block, a line is printed after the last line of the |
|---|
| 35 |
basic block describing the branch or call that ends the basic block. |
|---|
| 36 |
There can be multiple branches and calls listed for a single source |
|---|
| 37 |
line if there are multiple basic blocks that end on that line. |
|---|
| 38 |
In this case, the branches and calls are each given a number. |
|---|
| 39 |
There is no simple way to map these branches and calls back to source |
|---|
| 40 |
constructs. |
|---|
| 41 |
In general, though, the lowest numbered branch or call will correspond |
|---|
| 42 |
to the leftmost construct on the source line. |
|---|
| 43 |
.Pp |
|---|
| 44 |
For a branch, if it was executed at least once, then a percentage |
|---|
| 45 |
indicating the number of times the branch was tak" |
|---|
| 46 |
15669 cvs GIO fd 5 read 8 bytes |
|---|
| 47 |
"en divid" |
|---|
| 48 |
15669 cvs RET read 4096/0x1000 |
|---|
| 49 |
15669 cvs PSIG SIGSEGV SIG_DFL code 1 addr=0xd078ed08 trapno=2 |
|---|
| 50 |
15669 cvs NAMI "cvs.core" |
|---|