Re: [Ltp-coverage] branching docs?

On 06.12.2010 23:02, Jeremy C. Reed wrote:
> Please have a look at
> http://bind10.isc.org/~jreed/coverage/lib/cc/session.cc.gcov.html
> See line 359:
>
> 357 [ # # ]: 0 : for (int i = 0; i<
> impl_->queue_->size(); i++) {
> 358 : 0 : q_el =
> impl_->queue_->get(i);
> 359 [ # # ][ # # ]: 0 : if (( seq == -1&&
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ]
> 360 : : !q_el->get(0)->contains("reply")
>
> There are other places like this.
>
> I see the # means "The basic block containing the branch was never
> executed." Why is repeated?
The branch coverage data displayed by lcov is a graphical representation
of the data provided by GCC. In this case, it means that GCC created
that many branching instructions for the ending statement of the
for-loop you quoted.
> Also where is the explanation of + - versus - +
Each + or - indicates an exit from the branching block. + - indicates
that only the first exit was taken, - + indicates that only the second
exit was taken.
Also if you hover your mouse pointer over one of these symbols, it
should give an explanatory tool tip. You can also add a legend
describing the meaning of these symbols to the output using genhtml's
--legend switch.
Lastly there is this section in the man page of genhtml:
Branches are shown in the following format:
? + ?: Branch was taken at least once
? - ?: Branch was not taken
? # ?: The basic block containing the branch was never
executed
>
> I upgraded from 1.7 to 1.9. I had 94% coverage by lines and then 39%
> coverage by branches, so I am trying to understand this. Any pointers to
> docs would be appreciated.
Apart from the documentation quoted, there is very little else that I
can think of that might help here. It is important to note that it might
not be always possible to relate the branches shown in the output to the
corresponding source code statement - GCC may shuffle them around or
eliminate some which are not needed. The main information that you can
extract even in these cases is the number of branches which were not yet
taken in that line.
I'll add a line to the man page explaining this aspect some more.
Regards,
Peter Oberparleiter

On 06.12.2010 23:02, Jeremy C. Reed wrote:
> Please have a look at
> http://bind10.isc.org/~jreed/coverage/lib/cc/session.cc.gcov.html
> See line 359:
>
> 357 [ # # ]: 0 : for (int i = 0; i<
> impl_->queue_->size(); i++) {
> 358 : 0 : q_el =
> impl_->queue_->get(i);
> 359 [ # # ][ # # ]: 0 : if (( seq == -1&&
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ][ # # ]
> [ # # ]
> 360 : : !q_el->get(0)->contains("reply")
>
> There are other places like this.
>
> I see the # means "The basic block containing the branch was never
> executed." Why is repeated?
The branch coverage data displayed by lcov is a graphical representation
of the data provided by GCC. In this case, it means that GCC created
that many branching instructions for the ending statement of the
for-loop you quoted.
> Also where is the explanation of + - versus - +
Each + or - indicates an exit from the branching block. + - indicates
that only the first exit was taken, - + indicates that only the second
exit was taken.
Also if you hover your mouse pointer over one of these symbols, it
should give an explanatory tool tip. You can also add a legend
describing the meaning of these symbols to the output using genhtml's
--legend switch.
Lastly there is this section in the man page of genhtml:
Branches are shown in the following format:
? + ?: Branch was taken at least once
? - ?: Branch was not taken
? # ?: The basic block containing the branch was never
executed
>
> I upgraded from 1.7 to 1.9. I had 94% coverage by lines and then 39%
> coverage by branches, so I am trying to understand this. Any pointers to
> docs would be appreciated.
Apart from the documentation quoted, there is very little else that I
can think of that might help here. It is important to note that it might
not be always possible to relate the branches shown in the output to the
corresponding source code statement - GCC may shuffle them around or
eliminate some which are not needed. The main information that you can
extract even in these cases is the number of branches which were not yet
taken in that line.
I'll add a line to the man page explaining this aspect some more.
Regards,
Peter Oberparleiter

On Tue, 7 Dec 2010, Peter Oberparleiter wrote:
> Also if you hover your mouse pointer over one of these symbols, it
> should give an explanatory tool tip.
I had hoped that was a feature before I emailed but didn't see it. This
doesn't work for me. I have Firefox 3.6.4. I do see in the HTML source,
lines like:
<span class="lineNum"> 359 </span>[<span class="branchNoExec"
title="Branch 0 was not executed"> # </span><span class="branchNoExec"
title="Branch 1 was not executed"> # </span>][<span class="branchNoExec"
title="Branch 7 was not executed"> # </span><span class="branchNoExec"
title="Branch 8 was not executed"> # </span>]:<span class="lineNoCov">
0 : if (( seq == -1 &amp;&amp;</span>
So I guess those are the tool tips I should have seen. My cursor turns
from an arrow to a text input cursor when I am in the source part of the
webpage.
(I didn't look to close to the css or html nor research why this doesn't
work as intended.)
> You can also add a legend describing the meaning of these symbols to
> the output using genhtml's --legend switch.
Thanks.
> I'll add a line to the man page explaining this aspect some more.
Thank you Peter for the details!

On 07.12.2010 16:13, Jeremy C. Reed wrote:
> On Tue, 7 Dec 2010, Peter Oberparleiter wrote:
>
>> Also if you hover your mouse pointer over one of these symbols, it
>> should give an explanatory tool tip.
>
> I had hoped that was a feature before I emailed but didn't see it. This
> doesn't work for me. I have Firefox 3.6.4. I do see in the HTML source,
> lines like:
I tested it with Firefox 3.6.12 and it worked with that version. It
could be that you are experiencing a problem in Firefox, see e.g.:
http://support.mozilla.com/en-US/questions/760472?s=tooltip&as=s
You could also check if tool tips are altogether disabled in your browser:
http://kb.mozillazine.org/Browser.chrome.toolbar_tips
Regards,
Peter