Re: [PATCH v3 0/3] gcov: add Clang support

From: Tri Vo
Date: Tue Mar 12 2019 - 00:57:57 EST

On Tue, Mar 5, 2019 at 6:29 AM Peter Oberparleiter
<oberpar@xxxxxxxxxxxxx> wrote:
> On 23.01.2019 00:37, Tri Vo wrote:
> > This patch series adds Clang supoprt for gcov.
> >
> > Patch 1 refactors existing code in preparation for Clang support.
> > Patch 2 implements necessary LLVM runtime hooks and gcov kernel interfaces.
> > Patch 3 updates documentation.
> Thanks for the updates! I've provided suggestions for some minor
> improvements in my other review e-mails.
> With those changes applied, the patch set is in my opinion ready for
> inclusion into the mainline kernel. My suggestion would be to re-post
> the resulting version while putting Andrew Morton on CC as gcov changes
> are typically integrated via his tree.
> Also I've successfully re-tested this patch set version on s390 using
> GCC 7.3.0 to ensure that the existing GCC support is still working.
> Unfortunately I wasn't able to test the Clang version due to some
> compile problems on s390 (unrelated to this patch set).
> If you haven't done so, I would like to suggest to run the following
> tests with the Clang gcov-kernel version that should catch problems in
> some corner cases:
> 1. Unload a module, then use llvm-cov on the associated coverage file.
> Expectation: correct llvm-cov output including coverage of module
> exit code.
> 2. Unload a module, modify its source, re-compile it and load it again,
> then use llvm-cov on the associated coverage file.
> Expectation: kernel message "discarding saved data", correct llvm-cov
> output with no coverage of module exit code.
> 3. Unload a module, then reset all coverage data by writing to
> /sys/kernel/debug/gcov/reset.
> Expectation: all coverage files associated with the module are
> removed from debugfs.

Thanks for the suggested test cases! The current patchset doesn't seem
to handle module loading/unloading correctly. I'll fix that in a