]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: rds: add option for GCOV profiling
authorVegard Nossum <vegard.nossum@oracle.com>
Tue, 6 Aug 2024 15:38:08 +0000 (08:38 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Aug 2024 12:18:46 +0000 (13:18 +0100)
To better our unit tests we need code coverage to be part of the kernel.
This patch borrows heavily from how CONFIG_GCOV_PROFILE_FTRACE is
implemented

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rds/Kconfig
net/rds/Makefile

index 75cd696963b28028860ac39b7fe658a85036aafc..f007730aa2bb67843615922ef5342a260da31df5 100644 (file)
@@ -26,3 +26,12 @@ config RDS_DEBUG
        bool "RDS debugging messages"
        depends on RDS
        default n
+
+config GCOV_PROFILE_RDS
+       bool "Enable GCOV profiling on RDS"
+       depends on GCOV_KERNEL
+       help
+         Enable GCOV profiling on RDS for checking which functions/lines
+         are executed.
+
+         If unsure, say N.
index 8fdc118e292756247c8815e071f67ab6085df0ac..3af1ca1d965ce5ce65296a0db762273153ae08ac 100644 (file)
@@ -15,3 +15,8 @@ rds_tcp-y :=          tcp.o tcp_connect.o tcp_listen.o tcp_recv.o \
                        tcp_send.o tcp_stats.o
 
 ccflags-$(CONFIG_RDS_DEBUG)    :=      -DRDS_DEBUG
+
+# for GCOV coverage profiling
+ifdef CONFIG_GCOV_PROFILE_RDS
+GCOV_PROFILE := y
+endif