diff mbox series

[mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI"

Message ID 20240924-mptcp-gcov-v1-1-b259d5dc5fa6@kernel.org (mailing list archive)
State Accepted, archived
Commit 07234ab477d3d17f53667e220ed2568493f8f7c9
Delegated to: Matthieu Baerts
Headers show
Series [mptcp-next] Squash to "DO-NOT-MERGE: mptcp: improve code coverage for CI" | expand

Checks

Context Check Description
matttbe/build success Build and static analysis OK
matttbe/checkpatch warning total: 0 errors, 1 warnings, 0 checks, 21 lines checked
matttbe/shellcheck success MPTCP selftests files have not been modified
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug success Success! ✅
matttbe/KVM_Validation__btf__only_bpftest_all_ success Success! ✅

Commit Message

Matthieu Baerts (NGI0) Sept. 24, 2024, 4:39 p.m. UTC
And in "DO-NOT-MERGE: mptcp: improve code coverage for CI (net)".

This is similar to commit bc75dcc3cea7 ("net: rds: add option for GCOV
profiling"), but I don't think we need to upstream that. Or not for the
moment as the selftests don't depend on GCOV support.

If we do, we will also need to update Documentation/dev-tools/gcov.rst.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/Kconfig  | 9 +++++++++
 net/mptcp/Makefile | 5 +++++
 2 files changed, 14 insertions(+)


---
base-commit: d269ec78a30bc7a57999838c477a83b0e0101a57
change-id: 20240924-mptcp-gcov-49368d19b22f

Best regards,

Comments

Matthieu Baerts (NGI0) Sept. 24, 2024, 4:48 p.m. UTC | #1
Hello,

On 24/09/2024 18:39, Matthieu Baerts (NGI0) wrote:
> And in "DO-NOT-MERGE: mptcp: improve code coverage for CI (net)".
> 
> This is similar to commit bc75dcc3cea7 ("net: rds: add option for GCOV
> profiling"), but I don't think we need to upstream that. Or not for the
> moment as the selftests don't depend on GCOV support.
> 
> If we do, we will also need to update Documentation/dev-tools/gcov.rst.
FYI, I just applied this patch in our tree

- 66b668896210: "squashed" in "DO-NOT-MERGE: mptcp: improve code
coverage for CI (net)"
- 07234ab477d3: "squashed" in "DO-NOT-MERGE: mptcp: improve code
coverage for CI"

Cheers,
Matt
MPTCP CI Sept. 24, 2024, 5:36 p.m. UTC | #2
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/11018378042

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/1ce376cf68b0
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=892525


If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:

    $ cd [kernel source code]
    $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
        --pull always mptcp/mptcp-upstream-virtme-docker:latest \
        auto-normal

For more details:

    https://github.com/multipath-tcp/mptcp-upstream-virtme-docker


Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)

Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
diff mbox series

Patch

diff --git a/net/mptcp/Kconfig b/net/mptcp/Kconfig
index 10c97e19a7da5cbb1538b34a8eeca2e89795dfae..f674915dc31e521e6fe9dbcef03e65bdba10dd3d 100644
--- a/net/mptcp/Kconfig
+++ b/net/mptcp/Kconfig
@@ -37,4 +37,13 @@  config MPTCP_KUNIT_TEST
 
 	  If unsure, say N.
 
+config GCOV_PROFILE_MPTCP
+	bool "Enable GCOV profiling on MPTCP"
+	depends on GCOV_KERNEL
+	help
+	  Enable GCOV profiling on MPTCP for checking which functions/lines
+	  are executed.
+
+	  If unsure, say N.
+
 endif
diff --git a/net/mptcp/Makefile b/net/mptcp/Makefile
index bcf1dbf3a432f7423b048e985667f199797042b3..5dbc37d38d7a4b0779c71e7b291ef83a49e46648 100644
--- a/net/mptcp/Makefile
+++ b/net/mptcp/Makefile
@@ -13,3 +13,8 @@  mptcp_token_test-objs := token_test.o
 obj-$(CONFIG_MPTCP_KUNIT_TEST) += mptcp_crypto_test.o mptcp_token_test.o
 
 obj-$(CONFIG_BPF_SYSCALL) += bpf.o
+
+# for GCOV coverage profiling
+ifdef CONFIG_GCOV_PROFILE_MPTCP
+GCOV_PROFILE := y
+endif