We're using ltp and lcov for custom kernel drivers.
The platform is an arm11, we're using arm-linux-gcc 3.4.0 form codesourcery.com
We had to adjust the lcov perl script to get it works, and particulary the regexp in geninfo. The "([^:\s]+)" replaced with "([^:]+)", i'm not a regexp expert so i don't know if our modification has been done well (but it work for us).
For now, we would to have some coverage result per function, but the lcov script didn't seem to handle these types of info. Even if there is some piece of code in genhtml (FN tags), the geninfo didn't provide them...
And parsing the .gcov to get it didn't get information as useful as the gcov's stdout.
So why lcov parse itself the .gcov to get the statistics, as gcov provide "full" statistic on its standard output?
It's direct to parse the gcov's stdout...
I woul have another question related to gcov itself, is somebody know the difference between the block coverage and the branch coverage?
The first one is given by gcov in the "Function" item in .gcov (with -f flag).
The second is given by gcov as average coverage on its stdout and as detail in the .gcov (with -f flag).
3G Application Verification Engineer
CELAD on behalf of Freescale Semiconductor - WBSG EMEA
eMail: cgag1c AT freescale DOT com
From: Peter Oberparleiter <oberpapr@so...> - 2004-09-14 16:38:24
sorry for the late reply. Thanks for pointing out, that the creation of
FN: records does not currently work with GCC version 3.4.0 and above. I
checked geninfo and found a bug. A fix is available in the CVS version.
As for the regexp that didn't work - I couldn't find any error when
running lcov with GCC 3.4.1 - could you provide a sample .gcov file for
which geninfo would not correctly parse the data? (a few lines would do).
Regarding the output of coverage-per-function information - it shouldn't
be too difficult to generate that information from the .info files which
contain FN: tags (you'll need to use the fixed version of lcov). Maybe
this feature could be added as part of the lcov --list function, though
this is potential future work with no set date for completion.
We're not using the stdout information of the gcov tool as it has so far
not been important for the purpose of lcov. I don't currently see a need
to do this, especially since I'd expect this change to be rather
complex, given the number of different GCOV versions to support.
The difference between block and branch coverage can be derived from the
definition of blocks and branches: a (basic) block is a contiguous list
of instructions with no conditional checks inbetween while branches are
alternative connections between blocks which are taken depending on a
In this example, you have 4 basic blocks and two branches, one branch
from BLOCK 1 to BLOCK 2 and one from BLOCK 1 to BLOCK 3. If condition C
were true, you'd have a block coverage of 75% and a branch coverage of 50%.
Hope this helps.