Skip to content

Commit

Permalink
net: rds: add option for GCOV profiling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vegard authored and davem330 committed Aug 9, 2024
1 parent a0f6e5e commit bc75dcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions net/rds/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
5 changes: 5 additions & 0 deletions net/rds/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bc75dcc

Please sign in to comment.