netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters
authorKristof Provost <kp@FreeBSD.org>
Thu, 18 Jan 2024 19:44:47 +0000 (20:44 +0100)
committerKristof Provost <kp@FreeBSD.org>
Mon, 8 Apr 2024 15:29:59 +0000 (17:29 +0200)
commit60d8dbbef075d3b39891ed35e124d0f7ef8e5fb9
tree03c52ba2df8b62b08aaad65817abeba62fddbfdb
parent34791f4ac79ee41f6986178a3a89d13f37ac156c
netinet: add a probe point for IP, IP6, ICMP, ICMP6, UDP and TCP stats counters

When debugging network issues one common clue is an unexpectedly
incrementing error counter. This is helpful, in that it gives us an
idea of what might be going wrong, but often these counters may be
incremented in different functions.

Add a static probe point for them so that we can use dtrace to get
futher information (e.g. a stack trace).

For example:
dtrace -n 'mib:ip:count: { printf("%d", arg0); stack(); }'

This can be disabled by setting the following kernel option:
options  KDTRACE_NO_MIB_SDT

Reviewed by: gallatin, tuexen (previous version), gnn (previous version)
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D43504
17 files changed:
sys/conf/options
sys/netinet/icmp6.h
sys/netinet/icmp_var.h
sys/netinet/in_kdtrace.c
sys/netinet/in_kdtrace.h
sys/netinet/ip_icmp.c
sys/netinet/ip_var.h
sys/netinet/tcp_var.h
sys/netinet/udp_var.h
sys/netinet6/icmp6.c
sys/netinet6/in6_src.c
sys/netinet6/ip6_input.c
sys/netinet6/ip6_var.h
sys/netinet6/mld6.c
sys/netinet6/nd6_nbr.c
sys/netinet6/raw_ip6.c
sys/sys/sdt.h