From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: cota@braap.org, famz@redhat.com, berrange@redhat.com,
richard.henderson@linaro.org, balrogg@gmail.com,
aurelien@aurel32.net, agraf@suse.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 4/5] build-system: add clean-coverage target
Date: Wed, 20 Jun 2018 22:06:00 +0100 [thread overview]
Message-ID: <87muvpuq13.fsf@linaro.org> (raw)
In-Reply-To: <ffe5d74e-9cc0-e257-213a-56a44002bbfa@amsat.org>
Philippe Mathieu-Daudé <f4bug@amsat.org> writes:
> Hi Alex,
>
> On 06/20/2018 10:20 AM, Alex Bennée wrote:
>> This can be used to remove any stale coverage data before any
>> particular test run. This is useful for analysing individual tests.
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>> Makefile | 11 +++++++++++
>> docs/devel/testing.rst | 11 ++++++++---
>> 2 files changed, 19 insertions(+), 3 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index e46f2b625a..cb4af8bf80 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -725,6 +725,14 @@ module_block.h: $(SRC_PATH)/scripts/modules/module_block.py config-host.mak
>> $(addprefix $(SRC_PATH)/,$(patsubst %.mo,%.c,$(block-obj-m))), \
>> "GEN","$@")
>>
>> +ifdef CONFIG_GCOV
>> +.PHONY: clean-coverage
>> +clean-coverage:
>> + $(call quiet-command, \
>> + find . \( -name '*.gcda' -o -name '*.gcov' \) -type f -exec rm {} +, \
>> + "CLEAN", "coverage files")
>
> I also see ".gcno" files.
> From GCC man page:
>
> -ftest-coverage
> Produce a notes file that the gcov code-coverage
> utility can use to show program coverage. Each
> source file's note file is called auxname.gcno.
I explicitly left that out - the gcno file is regenerated by the build.
There is no reason to wipe it between coverage runs. A full clean should
remove them however.
>
> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> Adding gcno:
> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>
>> +endif
>> +
>> clean:
>> # avoid old build problems by removing potentially incorrect old files
>> rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
>> @@ -1075,6 +1083,9 @@ endif
>> echo '')
>> @echo 'Cleaning targets:'
>> @echo ' clean - Remove most generated files but keep the config'
>> +ifdef CONFIG_GCOV
>> + @echo ' clean-coverage - Remove coverage files'
>> +endif
>> @echo ' distclean - Remove all generated files'
>> @echo ' dist - Build a distributable tarball'
>> @echo ''
>> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
>> index 66ef219f69..a3652aea14 100644
>> --- a/docs/devel/testing.rst
>> +++ b/docs/devel/testing.rst
>> @@ -161,9 +161,14 @@ GCC gcov support
>> ``gcov`` is a GCC tool to analyze the testing coverage by
>> instrumenting the tested code. To use it, configure QEMU with
>> ``--enable-gcov`` option and build. Then run ``make check`` as usual.
>> -Reports can be obtained by running ``gcov`` command on the output
>> -files under ``$build_dir/tests/``, please read the ``gcov``
>> -documentation for more information.
>> +
>> +If you want to gather coverage information on a single test the ``make
>> +clean-coverage`` target can be used to any existing coverage
>> +information before running a single test.
>> +
>> +Reports can be obtained by running ``gcov`` command
>> +on the output files under ``$build_dir/tests/``, please read the
>> +``gcov`` documentation for more information.
>>
>> QEMU iotests
>> ============
>>
--
Alex Bennée
next prev parent reply other threads:[~2018-06-20 21:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-20 13:20 [Qemu-devel] [RFC PATCH 0/5] Tweak code coverage reporting Alex Bennée
2018-06-20 13:20 ` [Qemu-devel] [RFC PATCH 1/5] build-system: remove per-test GCOV reporting Alex Bennée
2018-06-20 20:25 ` Philippe Mathieu-Daudé
2018-06-20 13:20 ` [Qemu-devel] [RFC PATCH 2/5] .gitignore: add .gcov files Alex Bennée
2018-06-20 20:25 ` Philippe Mathieu-Daudé
2018-06-20 13:20 ` [Qemu-devel] [RFC PATCH 3/5] .travis.yml: add gcovr summary for GCOV build Alex Bennée
2018-06-20 20:30 ` Philippe Mathieu-Daudé
2018-06-20 20:46 ` Philippe Mathieu-Daudé
2018-06-20 21:04 ` Alex Bennée
2018-06-20 13:20 ` [Qemu-devel] [RFC PATCH 4/5] build-system: add clean-coverage target Alex Bennée
2018-06-20 20:33 ` Philippe Mathieu-Daudé
2018-06-20 21:06 ` Alex Bennée [this message]
2018-06-20 22:33 ` Philippe Mathieu-Daudé
2018-06-20 13:20 ` [Qemu-devel] [RFC PATCH 5/5] build-system: add coverage-report target Alex Bennée
2018-06-20 20:46 ` Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87muvpuq13.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=agraf@suse.de \
--cc=aurelien@aurel32.net \
--cc=balrogg@gmail.com \
--cc=berrange@redhat.com \
--cc=cota@braap.org \
--cc=f4bug@amsat.org \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.