Giter Site home page Giter Site logo

Comments (6)

henry2cox avatar henry2cox commented on September 8, 2024 1

Yes - this looks a bit strange/not consistent. One would expect to see the function definition line also hit, an either line 65 or 69, if we got to line 61.
It is possible that this is an lcov bug - but it is far more likely to be inconsistency in the data generated by gcc/gcov.
(That is: a gcc instrumentation bug, or a gcov translation bug.)

If possible, try a newer GCC or LLVM and see if the issue disappears.
(Note that - once you have that newer result, you can ask genhtml to generate a differential coverage report to compare the two - and see what is different.)

You can also try a newer lcov (say, by cloning the TOT or possibly downloading the 2.1-beta release version available above.)
I suspect that that won't produce a different result, though.

If you have a testcase which exhibits the issue: please attach.

Thanks

Henry

from lcov.

shaybra avatar shaybra commented on September 8, 2024 1

could the function have gotten inlined at compile time by any chance? Hence why it's internals got hit and not the function definition itself? Could you provide what your compiler flags are especially the optimization flag used?

from lcov.

shaybra avatar shaybra commented on September 8, 2024 1

@yangsee0 try removing the O2 flag and see if that helps after a recompile and run. I don't know if the inlining of functions has been overlooked or not when accounting for function coverage in gcov but it's worth a shot to try and see. Or you could use the gcc attribute noinline which will force the function not to be inlined by the compiler. follow this link for more

from lcov.

yangsee0 avatar yangsee0 commented on September 8, 2024

could the function have gotten inlined at compile time by any chance? Hence why it's internals got hit and not the function definition itself? Could you provide what your compiler flags are especially the optimization flag used?

Hello. It is performed with the options below.

-- C Flags : -Wbad-function-cast -Wincompatible-pointer-types-discards-qualifiers -Wenum-enum-conversion -Wimplicit-float-conversion -Wimplicit-int-float-conversion -Wimplicit-int-conversion -Wshorten-64-to-32 -O2 -D'FILE_NAME="$(subst .o,,$(@f))"' -march=cascadelake -Walloca -Wshift-overflow -Wstack-protector -Wformat -Wshadow -Wswitch-default -Wnull-dereference -Wredundant-decls -Wmissing-include-dirs -Wfloat-conversion -Wconversion -Wsign-conversion -Wall -Wextra
-- CXX Flags : -Wincompatible-pointer-types-discards-qualifiers -Wenum-enum-conversion -Wimplicit-float-conversion -Wimplicit-int-float-conversion -Wimplicit-int-conversion -Wshorten-64-to-32 -O2 -D'FILE_NAME="$(subst .o,,$(@f))"' -march=cascadelake -Walloca -Wshift-overflow -Wstack-protector -Wformat -Wshadow -Wswitch-default -Wnull-dereference -Wredundant-decls -Wmissing-include-dirs -Wfloat-conversion -Wconversion -Wsign-conversion -Wall -Wextra

from lcov.

yangsee0 avatar yangsee0 commented on September 8, 2024

Thank you for your advice.
The optimization option has been blocked and resolved.
We also confirmed that there is no problem with gcc 9.4.0.

from lcov.

shaybra avatar shaybra commented on September 8, 2024

Thank you for your advice. The optimization option has been blocked and resolved. We also confirmed that there is no problem with gcc 9.4.0.

happy to help!

from lcov.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.