diff mbox series

[RFC,net-next,2/3] net: rds: add option for GCOV profiling

Message ID 20240607003631.32484-3-allison.henderson@oracle.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series selftests: rds selftest | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit fail Errors and warnings before: 8 this patch: 894
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers warning 5 maintainers not CCed: pabeni@redhat.com edumazet@google.com kuba@kernel.org linux-rdma@vger.kernel.org rds-devel@oss.oracle.com
netdev/build_clang fail Errors and warnings before: 8 this patch: 868
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn fail Errors and warnings before: 8 this patch: 898
netdev/checkpatch warning WARNING: please write a help paragraph that fully describes the config symbol
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Allison Henderson June 7, 2024, 12:36 a.m. UTC
From: Vegard Nossum <vegard.nossum@oracle.com>

This commit basically implements what ftrace does with
CONFIG_GCOV_PROFILE_FTRACE for RDS.

We need this in order to better be able to understand what code paths
our unit tests are hitting (or not hitting).

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
---
 net/rds/Kconfig  | 9 +++++++++
 net/rds/Makefile | 5 +++++
 2 files changed, 14 insertions(+)

Comments

Allison Henderson June 9, 2024, 6:08 p.m. UTC | #1
On Thu, 2024-06-06 at 17:36 -0700, allison.henderson@oracle.com wrote:
+cc Chuck Lever, Peter Oberparleiter, Vegard Nossum, rds-devel
> From: Vegard Nossum <vegard.nossum@oracle.com>
> 
> This commit basically implements what ftrace does with
> CONFIG_GCOV_PROFILE_FTRACE for RDS.
> 
> We need this in order to better be able to understand what code paths
> our unit tests are hitting (or not hitting).
> 
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
> Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Allison Henderson <allison.henderson@oracle.com>
> ---
>  net/rds/Kconfig  | 9 +++++++++
>  net/rds/Makefile | 5 +++++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/net/rds/Kconfig b/net/rds/Kconfig
> index 75cd696963b2..f007730aa2bb 100644
> --- a/net/rds/Kconfig
> +++ b/net/rds/Kconfig
> @@ -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.
> diff --git a/net/rds/Makefile b/net/rds/Makefile
> index 8fdc118e2927..3af1ca1d965c 100644
> --- a/net/rds/Makefile
> +++ b/net/rds/Makefile
> @@ -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
diff mbox series

Patch

diff --git a/net/rds/Kconfig b/net/rds/Kconfig
index 75cd696963b2..f007730aa2bb 100644
--- a/net/rds/Kconfig
+++ b/net/rds/Kconfig
@@ -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.
diff --git a/net/rds/Makefile b/net/rds/Makefile
index 8fdc118e2927..3af1ca1d965c 100644
--- a/net/rds/Makefile
+++ b/net/rds/Makefile
@@ -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