blt icon indicating copy to clipboard operation
blt copied to clipboard

Is there any plan to add support for coverage tools like gcov/lcov

Open markcmiller86 opened this issue 5 years ago • 7 comments

markcmiller86 avatar Apr 13 '19 01:04 markcmiller86

@markcmiller86 -- We already support gcov and lcov, but it looks like it is not documented.

The functionality can be found here: https://github.com/LLNL/blt/blob/master/cmake/SetupCodeCoverageReports.cmake

I think you have to define a few variables (e.g. LCOV_EXECUTABLE) and include the above file in your build system. You probably also need to add some compiler flags...

I'll follow up next week with more detailed instructions.

kennyweiss avatar Apr 13 '19 02:04 kennyweiss

Ah, ok. Cool. Maybe if you cut-n-paste an example here, I can learn from that and maybe submit a doc update PR.

markcmiller86 avatar Apr 13 '19 02:04 markcmiller86

I think the support has atrophied. You definitely can compile with coverage flags. Many other folks use other services to generate reports. Codecov is a common one

On April 12, 2019 at 7:12:18 PM PDT, Mark C. Miller [email protected] wrote:

Ah, ok. Cool. Maybe if you cut-n-paste an example here, I can learn from that and maybe submit a doc update PR.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/LLNL/blt/issues/249#issuecomment-482767895, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABI6HudbJM7q_TFAYvg9RlXrkHw2R-LRks5vgTzwgaJpZM4ctx88.

cyrush avatar Apr 13 '19 02:04 cyrush

@cyrush ... yes, my goal is codecov integration. But, as I understand it, I need to gather coverage info somehow and gcov is the (common) way that coverage data is gathered before sending to codecov. If there is another/better way to gather coverage info, that is fine.

What I have been finding in my travisci builds of MACSio (not using BLT there yet) is that with coverage enabled, several of my tests segv in gcov_exit() but without coverage enabled they run fine. I thought it might be a problem with gcov version compatability with other parts of my tool-chain as I am apt-get installing mpich2 and hdf5. But, I checked for version incompatabilities and didn't see any. I use gcov/codecov in H5Z-ZFP project without issue but it isn't using mpich2

markcmiller86 avatar Apr 14 '19 20:04 markcmiller86

@markcmiller86 Is the problem just with the mpi tests? I recall that with mpi coverage can crash b/c by default all the tasks try to write to the same file. I forget how to mitigate this.

cyrush avatar Apr 15 '19 23:04 cyrush

@cyrush ... doh! That makes sense. What was I thinking??? Thanks for the tip. I will look into it.

markcmiller86 avatar Apr 16 '19 00:04 markcmiller86

FYI...I did find these two refs...

  • https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47618#c12

They get me close but not quite able to run an mpi app with coverage enabled and NOT have each rank clobber the other's .gcno or .gcda files generated by --coverage runs. If I could send different valued env. variables to different MPI ranks, problem solved.

Also, this ref indicates that a file system supporting locking would behave as desired...

https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

I dunno how to ensure the travis ubuntu image or my executables running in it are using such a file system.

markcmiller86 avatar Apr 18 '19 05:04 markcmiller86