On Tue, Mar 26, 2013 at 06:56:58AM +0100, Reinhard Tartler wrote:
> On Tue, Mar 26, 2013 at 12:07 AM, Diego Biurrun <[email protected]> wrote:
> > On Mon, Mar 25, 2013 at 08:37:20PM +0100, Reinhard Tartler wrote:
> >> The gcov/lcov are a common toolchain for visualizing code coverage with
> >> the GNU/Toolchain. The documentation and implementation of this
> >> integration was heavily inspired from the blog entry by Mike Melanson:
> >> http://multimedia.cx/eggs/using-lcov-with-ffmpeg/
> >
> > Why do you mention gcov when you are using lcov?
> >
> >> ---
> >>  .gitignore         |    4 ++++
> >>  Makefile           |    1 +
> >>  common.mak         |    2 +-
> >>  configure          |    4 ++++
> >>  doc/developer.texi |   22 ++++++++++++++++++++++
> >>  tests/Makefile     |    9 ++++++++-
> >>  6 files changed, 40 insertions(+), 2 deletions(-)
> >>
> >> the IMMEDIATE: "declaration" causes the coverage.info file to be deleted
> >> immediately. Otherwise, the developer would have to delete it by hand
> >> every time he runs another test in order to get updated results with
> >> 'make lcov'. I count this as a huge usability gain.
> >
> > What you describe sounds like a missing dependency declaration.  Indeed
> > the list of prerequisites for coverage.info is empty.  What is the
> > behavior you are looking for?
> 
> I don't think there is anything to improve here we are talking here
> about an convenience target so that the developer does not have to
> remember the exact lcov imposed workflow. The general idea is this:
> 
> a) you instrument the complete libav codebase, including the avconv
> binary, with profiling probes. This is done by the magic GCC compiler
> flags.
> 
> b) you run your workload. This may be 'make fate' on fate machines,
> but I expect the regular developer to call avconv by hand on some more
> or less random samples in his shell.
> 
> c) this invocation will create some gcda files, which contain the data
> produced by the implanted probes in the code from step a)
> 
> d) lcov scans the build tree for these gcda files, and distills them
> into a more or less compact format "coverage.info". This file can be
> consumed by a number of front-ends, for instance, there is a jenkins
> plugin that can consume it, but in this patch, I propose to use the
> lcov tool, which produces HTML.
> 
> Having said this, it does make sense to provide the coverage.info file
> as makefile target, because you might want to have it for other uses
> than lcov. For instance, I plan to play with a jenkins job that
> produces a nicer HTML output and statistics over time, etc..

So basically coverage.info should be updated every time a gcda file
changes and not deleted immediately.  I'll see if I can cook up
something.

> >> --- a/doc/developer.texi
> >> +++ b/doc/developer.texi
> >> @@ -550,6 +550,28 @@ why the expected result changed.
> >>
> >> +@subsection Visualizing Test Coverage
> >> +
> >> +The Libav build system provides means for visualizing the test coverage
> >> +leveraging the coverage tools @code{gcov}/@code{lcov} in an easy manner.
> >
> > I'd say s/in an easy manner//, that's for the users to judge.  But if
> > you prefer, feel free to keep it.
> 
> I'd prefer to keep it. your questions indicate that gcov/lcov is not
> exactly straight-forward to use, so that side-note seems warranted to
> me.

I suggest:

  The Libav build system allows visualizing the coverage in an easy
  manner through the @code{gcov} / @code{lcov} tools.

> >> +This involves the following steps:
> >> +
> >> +@enumerate
> >> +@item
> >> +   Configure to compile with instrumentation enabled:
> >> +   @code{configure --toolchain=gcov}.
> >
> > Use 4 spaces as indentation.  I know that there is a list in that file
> > that uses only 3, but let's not add more weirdness.
> 
> fixed locally.
> 
> Can you propose a patch that normalizes the indentation for the
> texinfo files to avoid such copy mistakes in the future, please?

I have something locally, will send in a few.

> >> --- a/tests/Makefile
> >> +++ b/tests/Makefile
> >> @@ -123,6 +123,12 @@ $(FATE): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
> >>
> >> +coverage.info:
> >> +     lcov -d $(CURDIR) -b $(SRC_PATH) --capture -o $@
> >> +
> >> +lcov: coverage.info
> >> +     genhtml -o $(CURDIR)/lcov $<

The online man page for genhtml says that the current directory is the default
output location.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to