Skip to contentSkip to conversation

netfilter: add option for GCOV profiling

PATCH Superseded Florian Westphal 1 participant 1 message May 7

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: add option for GCOV profiling

Similar to a few other subsystems: add a new config toggle to enable netfilter gcov profiling in netfilter, including ebtables, arptables and so on.

---
NB: This doesn't enable profiling for br_netfilter kludge, because it resides in net/bridge/ dir. As I'm not interested in extending coverage for that thing I did not extend this.

 net/bridge/netfilter/Makefile | 4 ++++
 net/ipv4/netfilter/Makefile   | 4 ++++
 net/ipv6/netfilter/Makefile   | 4 ++++
 net/netfilter/Kconfig         | 8 ++++++++
 net/netfilter/Makefile        | 4 ++++
 5 files changed, 24 insertions(+)
net/bridge/netfilter/Makefile +4 -0
index b9a1303da977..af0c903aa4ac 100644
@@ -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
net/ipv4/netfilter/Makefile +4 -0
index 85502d4dfbb4..dbfb1c4739a8 100644
@@ -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
net/ipv6/netfilter/Makefile +4 -0
index 66ce6fa5b2f5..72902d8005ad 100644
@@ -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
net/netfilter/Kconfig +8 -0
index 682c675125fc..a3b844421515 100644
@@ -1648,6 +1648,14 @@ config NETFILTER_XT_MATCH_U32
 
 endif # NETFILTER_XTABLES
 
+config GCOV_PROFILE_NETFILTER
+	bool "Enable GCOV profiling for netilter"
+	depends on GCOV_KERNEL
+	help
+	  Enable GCOV profiling for netfilter for checking which functions/lines
+	  are executed.
+
+	  If unsure, say N.
 endmenu
 
 source "net/netfilter/ipset/Kconfig"
net/netfilter/Makefile +4 -0
index 6bfc250e474f..f0751ca302c6 100644
@@ -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
Signature · 1 line
2.53.0