]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netfilter: add option for GCOV profiling
authorFlorian Westphal <fw@strlen.de>
Thu, 7 May 2026 09:34:15 +0000 (11:34 +0200)
committerFlorian Westphal <fw@strlen.de>
Sun, 24 May 2026 20:55:47 +0000 (22:55 +0200)
Similar to a few other subsystems: add a new config toggle to
enable netfilter gcov profiling in netfilter, including ebtables,
arptables and so on.

ipset and ipvs gain their own, dedicated toggles.

Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Florian Westphal <fw@strlen.de>
12 files changed:
net/bridge/Makefile
net/bridge/netfilter/Makefile
net/ipv4/Makefile
net/ipv4/netfilter/Makefile
net/ipv6/Makefile
net/ipv6/netfilter/Makefile
net/netfilter/Kconfig
net/netfilter/Makefile
net/netfilter/ipset/Kconfig
net/netfilter/ipset/Makefile
net/netfilter/ipvs/Kconfig
net/netfilter/ipvs/Makefile

index 24bd1c0a9a5a33610f163ca7897b55bcc709f403..1203dc19e15c9ebf17790ea01380c7a4daf6b0b9 100644 (file)
@@ -29,3 +29,9 @@ obj-$(CONFIG_NETFILTER) += netfilter/
 bridge-$(CONFIG_BRIDGE_MRP)    += br_mrp_switchdev.o br_mrp.o br_mrp_netlink.o
 
 bridge-$(CONFIG_BRIDGE_CFM)    += br_cfm.o br_cfm_netlink.o
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE_br_nf_core.o := y
+GCOV_PROFILE_br_netfilter_hooks.o := y
+GCOV_PROFILE_br_netfilter_ipv6.o := y
+endif
index b9a1303da9771d7590bd3eb878e904aaec92e567..af0c903aa4aceefe53ce755c34ad8d12251216a4 100644 (file)
@@ -38,3 +38,7 @@ obj-$(CONFIG_BRIDGE_EBT_SNAT) += ebt_snat.o
 # watchers
 obj-$(CONFIG_BRIDGE_EBT_LOG) += ebt_log.o
 obj-$(CONFIG_BRIDGE_EBT_NFLOG) += ebt_nflog.o
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE := y
+endif
index 7964234f0d088f33118895d02c4a1069d6d154e5..06e21c26b76f2edf8123d5219c539fc4fbdc13e8 100644 (file)
@@ -71,3 +71,7 @@ obj-$(CONFIG_TCP_AO) += tcp_ao.o
 ifeq ($(CONFIG_BPF_JIT),y)
 obj-$(CONFIG_BPF_SYSCALL) += bpf_tcp_ca.o
 endif
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE_netfilter.o := y
+endif
index 85502d4dfbb4d2da45e13759aaa492345b452251..dbfb1c4739a87c830db664feebb675ad756a2d22 100644 (file)
@@ -51,3 +51,7 @@ obj-$(CONFIG_IP_NF_ARP_MANGLE) += arpt_mangle.o
 obj-$(CONFIG_IP_NF_ARPFILTER) += arptable_filter.o
 
 obj-$(CONFIG_NF_DUP_IPV4) += nf_dup_ipv4.o
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE := y
+endif
index 2c9ce2ccbde17b9aaa0acf62e1b86885e55ab95d..5b0cd648802124b74d999ed449ef4d12f0306c65 100644 (file)
@@ -54,3 +54,7 @@ obj-$(CONFIG_NET_UDP_TUNNEL) += ip6_udp_tunnel.o
 obj-y += mcast_snoop.o
 obj-$(CONFIG_TCP_AO) += tcp_ao.o
 endif
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE_netfilter.o := y
+endif
index 66ce6fa5b2f52a7978565abc0adb1ec9708de6d2..72902d8005ad9b40bd7f8e2c1afee78691a52b13 100644 (file)
@@ -43,3 +43,7 @@ obj-$(CONFIG_IP6_NF_MATCH_SRH) += ip6t_srh.o
 obj-$(CONFIG_IP6_NF_TARGET_NPT) += ip6t_NPT.o
 obj-$(CONFIG_IP6_NF_TARGET_REJECT) += ip6t_REJECT.o
 obj-$(CONFIG_IP6_NF_TARGET_SYNPROXY) += ip6t_SYNPROXY.o
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE := y
+endif
index 682c675125fc1f6d9f304b930b6cd509c014deea..f71ff98eb5d08ac8276919677586b7f9b48a634d 100644 (file)
@@ -1648,6 +1648,14 @@ config NETFILTER_XT_MATCH_U32
 
 endif # NETFILTER_XTABLES
 
+config GCOV_PROFILE_NETFILTER
+       bool "Enable GCOV profiling for netfilter"
+       depends on GCOV_KERNEL
+       help
+         Enable GCOV profiling for netfilter to check which functions/lines
+         are executed.
+
+         If unsure, say N.
 endmenu
 
 source "net/netfilter/ipset/Kconfig"
index 6bfc250e474fe0ad371a63282a68342fe40fcd97..f0751ca302c6b6661048c6dc0f2c0ea245891862 100644 (file)
@@ -240,3 +240,7 @@ obj-$(CONFIG_IP_VS) += ipvs/
 
 # lwtunnel
 obj-$(CONFIG_LWTUNNEL) += nf_hooks_lwtunnel.o
+
+ifdef CONFIG_GCOV_PROFILE_NETFILTER
+GCOV_PROFILE := y
+endif
index b1ea054bb82c8d6ea2f4250cb2b30c0eaa8616d1..6c4d5475810670ad68a2b06b750ebd16bc7dde29 100644 (file)
@@ -175,4 +175,13 @@ config IP_SET_LIST_SET
 
          To compile it as a module, choose M here.  If unsure, say N.
 
+config GCOV_PROFILE_IPSET
+       bool "Enable GCOV profiling for ipset"
+       depends on GCOV_KERNEL
+       help
+         Enable GCOV profiling for ipset to check which functions/lines
+         are executed.
+
+         If unsure, say N.
+
 endif # IP_SET
index a445a6bf4f111b0c99a98d8bb396018f269593b7..4f48df5406cd320c989bf3e334be6d6c5fa36ce9 100644 (file)
@@ -29,3 +29,6 @@ obj-$(CONFIG_IP_SET_HASH_NETPORTNET) += ip_set_hash_netportnet.o
 
 # list types
 obj-$(CONFIG_IP_SET_LIST_SET) += ip_set_list_set.o
+ifdef CONFIG_GCOV_PROFILE_IPSET
+GCOV_PROFILE := y
+endif
index c203252e856d8c5466c589c978c1605351d885f5..7724cb44e6dea87d3511a1a205e6e6650513062a 100644 (file)
@@ -349,4 +349,13 @@ config     IP_VS_PE_SIP
        help
          Allow persistence based on the SIP Call-ID
 
+config GCOV_PROFILE_IPVS
+       bool "Enable GCOV profiling for IPVS"
+       depends on GCOV_KERNEL
+       help
+         Enable GCOV profiling for IPVS to check which functions/lines
+         are executed.
+
+         If unsure, say N.
+
 endif # IP_VS
index bb5d8125c82ab692582c038aff348921d5d8a617..8e4cc67ad39d5f64d103b6cd1654be3217b0b367 100644 (file)
@@ -43,3 +43,6 @@ obj-$(CONFIG_IP_VS_FTP) += ip_vs_ftp.o
 
 # IPVS connection template retrievers
 obj-$(CONFIG_IP_VS_PE_SIP) += ip_vs_pe_sip.o
+ifdef CONFIG_GCOV_PROFILE_IPVS
+GCOV_PROFILE := y
+endif