diff --git a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h index e29654e..855bf17 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h +++ b/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h @@ -11,6 +11,8 @@ extern "C" { #endif +#include + #if _DTRACE_VERSION #define TESTER_ENTRY() \ diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile index 4fd7fae..ff1a220 100644 --- a/cddl/lib/libdtrace/Makefile +++ b/cddl/lib/libdtrace/Makefile @@ -48,6 +48,7 @@ SRCS= dt_aggregate.c \ DSRCS= errno.d \ io.d \ + ip.d \ psinfo.d \ signal.d \ unistd.d diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d new file mode 100644 index 0000000..c898397 --- /dev/null +++ b/cddl/lib/libdtrace/ip.d @@ -0,0 +1,282 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + */ +/* + * Copyright (c) 2013 Mark Johnston + */ + +#pragma D depends_on provider ip + +/* + * pktinfo is where packet ID info can be made available for deeper + * analysis if packet IDs become supported by the kernel in the future. + * The pkt_addr member is currently always NULL. + */ +typedef struct pktinfo { + uintptr_t pkt_addr; +} pktinfo_t; + +/* + * csinfo is where connection state info is made available. + */ +typedef struct csinfo { + uintptr_t cs_addr; + uint64_t cs_cid; + pid_t cs_pid; + zoneid_t cs_zoneid; +} csinfo_t; + +/* + * ipinfo contains common IP info for both IPv4 and IPv6. + */ +typedef struct ipinfo { + uint8_t ip_ver; /* IP version (4, 6) */ + uint32_t ip_plength; /* payload length */ + string ip_saddr; /* source address */ + string ip_daddr; /* destination address */ +} ipinfo_t; + +/* + * ifinfo contains network interface info. + */ +typedef struct ifinfo { + string if_name; /* interface name */ + int8_t if_local; /* is delivered locally */ + /*netstackid_t if_ipstack;*/ /* ipstack ID */ + uintptr_t if_addr; /* pointer to raw ill_t */ +} ifinfo_t; + +typedef uint32_t ipaddr_t; + +typedef struct { + uint8_t ipha_version_and_hdr_length; + uint8_t ipha_type_of_service; + uint16_t ipha_length; + uint16_t ipha_ident; + uint16_t ipha_fragment_offset_and_flags; + uint8_t ipha_ttl; + uint8_t ipha_protocol; + uint16_t ipha_hdr_checksum; + ipaddr_t ipha_src; + ipaddr_t ipha_dst; +} ipha_t; + +/* + * ipv4info is a translated version of the IPv4 header (with raw pointer). + * These values are NULL if the packet is not IPv4. + */ +typedef struct ipv4info { + uint8_t ipv4_ver; /* IP version (4) */ + uint8_t ipv4_ihl; /* header length, bytes */ + uint8_t ipv4_tos; /* type of service field */ + uint16_t ipv4_length; /* length (header + payload) */ + uint16_t ipv4_ident; /* identification */ + uint8_t ipv4_flags; /* IP flags */ + uint16_t ipv4_offset; /* fragment offset */ + uint8_t ipv4_ttl; /* time to live */ + uint8_t ipv4_protocol; /* next level protocol */ + string ipv4_protostr; /* next level protocol, as a string */ + uint16_t ipv4_checksum; /* header checksum */ + ipaddr_t ipv4_src; /* source address */ + ipaddr_t ipv4_dst; /* destination address */ + string ipv4_saddr; /* source address, string */ + string ipv4_daddr; /* destination address, string */ + ipha_t *ipv4_hdr; /* pointer to raw header */ +} ipv4info_t; + +typedef struct in6_addr in6_addr_t; + +typedef struct ip6_hdr ip6_t; + +/* + * ipv6info is a translated version of the IPv6 header (with raw pointer). + * These values are NULL if the packet is not IPv6. + */ +typedef struct ipv6info { + uint8_t ipv6_ver; /* IP version (6) */ + uint8_t ipv6_tclass; /* traffic class */ + uint32_t ipv6_flow; /* flow label */ + uint16_t ipv6_plen; /* payload length */ + uint8_t ipv6_nexthdr; /* next header protocol */ + string ipv6_nextstr; /* next header protocol, as a string */ + uint8_t ipv6_hlim; /* hop limit */ + in6_addr_t *ipv6_src; /* source address */ + in6_addr_t *ipv6_dst; /* destination address */ + string ipv6_saddr; /* source address, string */ + string ipv6_daddr; /* destination address, string */ + ip6_t *ipv6_hdr; /* pointer to raw header */ +} ipv6info_t; + +#pragma D binding "1.0" IPPROTO_IP +inline short IPPROTO_IP = 0; +#pragma D binding "1.0" IPPROTO_ICMP +inline short IPPROTO_ICMP = 1; +#pragma D binding "1.0" IPPROTO_IGMP +inline short IPPROTO_IGMP = 2; +#pragma D binding "1.0" IPPROTO_IPV4 +inline short IPPROTO_IPV4 = 4; +#pragma D binding "1.0" IPPROTO_TCP +inline short IPPROTO_TCP = 6; +#pragma D binding "1.0" IPPROTO_UDP +inline short IPPROTO_UDP = 17; +#pragma D binding "1.0" IPPROTO_IPV6 +inline short IPPROTO_IPV6 = 41; +#pragma D binding "1.0" IPPROTO_ROUTING +inline short IPPROTO_ROUTING = 43; +#pragma D binding "1.0" IPPROTO_FRAGMENT +inline short IPPROTO_FRAGMENT = 44; +#pragma D binding "1.0" IPPROTO_RSVP +inline short IPPROTO_RSVP = 46; +#pragma D binding "1.0" IPPROTO_GRE +inline short IPPROTO_GRE = 47; +#pragma D binding "1.0" IPPROTO_ESP +inline short IPPROTO_ESP = 50; +#pragma D binding "1.0" IPPROTO_AH +inline short IPPROTO_AH = 51; +#pragma D binding "1.0" IPPROTO_MOBILE +inline short IPPROTO_MOBILE = 55; +#pragma D binding "1.0" IPPROTO_ICMPV6 +inline short IPPROTO_ICMPV6 = 58; +#pragma D binding "1.0" IPPROTO_DSTOPTS +inline short IPPROTO_DSTOPTS = 60; +#pragma D binding "1.0" IPPROTO_ETHERIP +inline short IPPROTO_ETHERIP = 97; +#pragma D binding "1.0" IPPROTO_PIM +inline short IPPROTO_PIM = 103; +#pragma D binding "1.0" IPPROTO_IPCOMP +inline short IPPROTO_IPCOMP = 108; +#pragma D binding "1.0" IPPROTO_SCTP +inline short IPPROTO_SCTP = 132; +#pragma D binding "1.0" IPPROTO_RAW +inline short IPPROTO_RAW = 255; + +#pragma D binding "1.0" protocols +inline string protocols[int proto] = + proto == IPPROTO_IP ? "IP" : + proto == IPPROTO_ICMP ? "ICMP" : + proto == IPPROTO_IGMP ? "IGMP" : + proto == IPPROTO_IPV4 ? "IPV4" : + proto == IPPROTO_TCP ? "TCP" : + proto == IPPROTO_UDP ? "UDP" : + proto == IPPROTO_IPV6 ? "IPV6" : + proto == IPPROTO_ROUTING ? "ROUTING" : + proto == IPPROTO_FRAGMENT ? "FRAGMENT" : + proto == IPPROTO_RSVP ? "RSVP" : + proto == IPPROTO_GRE ? "GRE" : + proto == IPPROTO_ESP ? "ESP" : + proto == IPPROTO_AH ? "AH" : + proto == IPPROTO_MOBILE ? "MOBILE" : + proto == IPPROTO_ICMPV6 ? "ICMPV6" : + proto == IPPROTO_DSTOPTS ? "DSTOPTS" : + proto == IPPROTO_ETHERIP ? "ETHERIP" : + proto == IPPROTO_PIM ? "PIM" : + proto == IPPROTO_IPCOMP ? "IPCOMP" : + proto == IPPROTO_SCTP ? "SCTP" : + proto == IPPROTO_RAW ? "RAW" : + ""; + +/* + * This field is always NULL according to the current definition of the ip + * probes. + */ +#pragma D binding "1.0" translator +translator pktinfo_t < void *p > { + pkt_addr = NULL; +}; + +/* + * This field is always NULL in version 1.5 of the translation. + */ +#pragma D binding "1.0" translator +translator csinfo_t < void *p > { + cs_addr = NULL; + cs_cid = (int)p; + cs_pid = 0; + cs_zoneid = 0; +}; + +#pragma D binding "1.0" translator +translator ipinfo_t < struct mbuf *p > { + ip_ver = p == NULL ? 0 : ((struct ip *)p->m_hdr.mh_data)->ip_v; + ip_plength = p == NULL ? 0 : + ((struct ip *)p->m_hdr.mh_data)->ip_v == 4 ? + ntohs(((struct ip *)p->m_hdr.mh_data)->ip_len) : + ((struct ip *)p->m_hdr.mh_data)->ip_v == 6 ? + ntohs(((struct ip6_hdr *)p->m_hdr.mh_data)->ip6_ctlun.ip6_un1.ip6_un1_plen) : 0; + ip_saddr = p == NULL ? 0 : + ((struct ip *)p->m_hdr.mh_data)->ip_v == 4 ? + inet_ntoa(&((struct ip *)p->m_hdr.mh_data)->ip_src.s_addr) : + ((struct ip *)p->m_hdr.mh_data)->ip_v == 6 ? + inet_ntoa6(&((struct ip6_hdr *)p->m_hdr.mh_data)->ip6_src) : 0; + ip_daddr = p == NULL ? 0 : + ((struct ip *)p->m_hdr.mh_data)->ip_v == 4 ? + inet_ntoa(&((struct ip *)p->m_hdr.mh_data)->ip_dst.s_addr) : + ((struct ip *)p->m_hdr.mh_data)->ip_v == 6 ? + inet_ntoa6(&((struct ip6_hdr *)p->m_hdr.mh_data)->ip6_dst) : 0; +}; + +#pragma D binding "1.0" IFF_LOOPBACK +inline int IFF_LOOPBACK = 0x8; + +#pragma D binding "1.0" translator +translator ifinfo_t < struct ifnet *p > { + if_name = p->if_xname; + if_local = (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1; + if_addr = (uintptr_t)p; +}; + +#pragma D binding "1.0" translator +translator ipv4info_t < struct ip *p > { + ipv4_ver = p == NULL ? 0 : p->ip_v; + ipv4_ihl = p == NULL ? 0 : p->ip_hl; + ipv4_tos = p == NULL ? 0 : p->ip_tos; + ipv4_length = p == NULL ? 0 : ntohs(p->ip_len); + ipv4_ident = p == NULL ? 0 : p->ip_id; + ipv4_flags = p == NULL ? 0 : (p->ip_off & 0xe000); + ipv4_offset = p == NULL ? 0 : p->ip_off; + ipv4_ttl = p == NULL ? 0 : p->ip_ttl; + ipv4_protocol = p == NULL ? 0 : p->ip_p; + ipv4_protostr = p == NULL ? "" : protocols[p->ip_p]; + ipv4_checksum = p == NULL ? 0 : p->ip_sum; + ipv4_src = p == NULL ? 0 : (ipaddr_t)p->ip_src.s_addr; + ipv4_dst = p == NULL ? 0 : (ipaddr_t)p->ip_dst.s_addr; + ipv4_saddr = p == NULL ? 0 : inet_ntoa(&p->ip_src.s_addr); + ipv4_daddr = p == NULL ? 0 : inet_ntoa(&p->ip_dst.s_addr); + ipv4_hdr = (ipha_t *)p; +}; + +#pragma D binding "1.0" translator +translator ipv6info_t < struct ip6_hdr *p > { + ipv6_ver = p == NULL ? 0 : (p->ip6_ctlun.ip6_un1.ip6_un1_flow & 0xf0000000); + ipv6_tclass = p == NULL ? 0 : (p->ip6_ctlun.ip6_un1.ip6_un1_flow & 0x0ff00000); + ipv6_flow = p == NULL ? 0 : (p->ip6_ctlun.ip6_un1.ip6_un1_flow & 0x000fffff); + ipv6_plen = p == NULL ? 0 : p->ip6_ctlun.ip6_un1.ip6_un1_plen; + ipv6_nexthdr = p == NULL ? 0 : p->ip6_ctlun.ip6_un1.ip6_un1_nxt; + ipv6_nextstr = p == NULL ? "" : protocols[p->ip6_ctlun.ip6_un1.ip6_un1_nxt]; + ipv6_hlim = p == NULL ? 0 : p->ip6_ctlun.ip6_un1.ip6_un1_hlim; + ipv6_src = p == NULL ? 0 : (in6_addr_t *)&p->ip6_src; + ipv6_dst = p == NULL ? 0 : (in6_addr_t *)&p->ip6_dst; + ipv6_saddr = p == NULL ? 0 : inet_ntoa6(&p->ip6_src); + ipv6_daddr = p == NULL ? 0 : inet_ntoa6(&p->ip6_dst); + ipv6_hdr = (ip6_t *)p; +}; diff --git a/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c b/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c index 66ff8a9..ef938d4 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c +++ b/sys/cddl/contrib/opensolaris/uts/common/dtrace/sdt_subr.c @@ -91,6 +91,7 @@ sdt_provider_t sdt_providers[] = { { "sched", "__sched_", &stab_attr, 0 }, { "proc", "__proc_", &stab_attr, 0 }, { "io", "__io_", &stab_attr, 0 }, + { "ip", "__ip_", &stab_attr, 0 }, { "mib", "__mib_", &stab_attr, 0 }, { "fsinfo", "__fsinfo_", &fsinfo_attr, 0 }, { "nfsv3", "__nfsv3_", &stab_attr, 0 }, @@ -788,6 +789,19 @@ sdt_argdesc_t sdt_args[] = { "nfsv4cbinfo_t *" }, { "nfsv4", "cb-recall-done", 2, 2, "CB_RECALL4res *" }, + { "ip", "send", 0, 0, "void *", "pktinfo_t *" }, + { "ip", "send", 1, 1, "void *", "csinfo_t *" }, + { "ip", "send", 2, 2, "struct mbuf *", "ipinfo_t *" }, + { "ip", "send", 3, 3, "struct ifnet *", "ifinfo_t *" }, + { "ip", "send", 4, 4, "struct ip *", "ipv4info_t *" }, + { "ip", "send", 5, 5, "struct ip6_hdr *", "ipv6info_t *" }, + { "ip", "receive", 0, 0, "void *", "pktinfo_t *" }, + { "ip", "receive", 1, 1, "void *", "csinfo_t *" }, + { "ip", "receive", 2, 2, "struct mbuf *", "ipinfo_t *" }, + { "ip", "receive", 3, 3, "struct ifnet *", "ifinfo_t *" }, + { "ip", "receive", 4, 4, "struct ip *", "ipv4info_t *" }, + { "ip", "receive", 5, 5, "struct ip6_hdr *", "ipv6info_t *" }, + { "sysevent", "post", 0, 0, "evch_bind_t *", "syseventchaninfo_t *" }, { "sysevent", "post", 1, 1, "sysevent_impl_t *", "syseventinfo_t *" }, diff --git a/sys/cddl/dev/dtrace/dtrace_test.c b/sys/cddl/dev/dtrace/dtrace_test.c index f50ad89..f3b7491 100644 --- a/sys/cddl/dev/dtrace/dtrace_test.c +++ b/sys/cddl/dev/dtrace/dtrace_test.c @@ -27,7 +27,6 @@ */ #include "opt_kdtrace.h" -#include #include #include #include diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 3a228ca..3ce727c 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_ipstealth.h" +#include "opt_kdtrace.h" #include #include @@ -85,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -112,6 +114,10 @@ static VNET_DEFINE(int, ipfastforward_active); SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_RW, &VNET_NAME(ipfastforward_active), 0, "Enable fast IP forwarding"); +SDT_PROVIDER_DECLARE(ip); + +SDT_PROBE_DECLARE(ip, , , send); + static struct sockaddr_in * ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) { @@ -527,6 +533,7 @@ passout: /* * Send off the packet via outgoing interface */ + SDT_PROBE6(ip, , , send, 0, 0, m, ifp, mtod(m, struct ip *), 0); error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, &ro); } else { @@ -554,6 +561,8 @@ passout: m0 = m->m_nextpkt; m->m_nextpkt = NULL; + SDT_PROBE6(ip, , , send, 0, 0, m, ifp, + mtod(m, struct ip *), 0); error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst, &ro); if (error) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index f38c6fa..db75509 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_ipstealth.h" #include "opt_ipsec.h" +#include "opt_kdtrace.h" #include "opt_route.h" #include @@ -49,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -214,6 +216,11 @@ static void ip_freef(struct ipqhead *, struct ipq *); */ VNET_DEFINE(struct ipstat_p, ipstatp); +SDT_PROVIDER_DEFINE(ip); + +SDT_PROBE_DEFINE6(ip, , , receive, receive, "void *", "void *", "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + static void vnet_ipstatp_init(const void *unused) { @@ -485,6 +492,8 @@ ip_input(struct mbuf *m) ip = mtod(m, struct ip *); } + SDT_PROBE6(ip, , , receive, 0, 0, m, m->m_pkthdr.rcvif, ip, 0); + /* 127/8 must not appear on wire - RFC1122 */ ifp = m->m_pkthdr.rcvif; if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || @@ -1420,6 +1429,7 @@ ip_forward(struct mbuf *m, int srcrt) struct route ro; int error, type = 0, code = 0, mtu = 0; + if (m->m_flags & (M_BCAST|M_MCAST) || in_canforward(ip->ip_dst) == 0) { IPSTAT_INC(ips_cantforward); m_freem(m); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 21d47f7..e47b25e 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -34,9 +34,10 @@ __FBSDID("$FreeBSD$"); #include "opt_ipfw.h" #include "opt_ipsec.h" -#include "opt_route.h" +#include "opt_kdtrace.h" #include "opt_mbuf_stress_test.h" #include "opt_mpath.h" +#include "opt_route.h" #include "opt_sctp.h" #include @@ -47,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -99,6 +101,11 @@ static void ip_mloopback extern int in_mcast_loop; extern struct protosw inetsw[]; +SDT_PROVIDER_DECLARE(ip); + +SDT_PROBE_DEFINE6(ip, , , send, send, "void *", "void *", "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + /* * IP output. The packet in mbuf chain m contains a skeletal IP * header (with len, off, ttl, proto, tos, src, dst). @@ -622,6 +629,7 @@ passout: * to avoid confusing lower layers. */ m->m_flags &= ~(M_PROTOFLAGS); + SDT_PROBE6(ip, , , send, 0, 0, m, ifp, ip, 0); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); goto done; @@ -656,6 +664,7 @@ passout: */ m->m_flags &= ~(M_PROTOFLAGS); + SDT_PROBE6(ip, , , send, 0, 0, m, ifp, ip, 0); error = (*ifp->if_output)(ifp, m, (const struct sockaddr *)gw, ro); } else diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c index 51af22b..739e104 100644 --- a/sys/netinet6/ip6_input.c +++ b/sys/netinet6/ip6_input.c @@ -67,21 +67,23 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_ipfw.h" #include "opt_ipsec.h" +#include "opt_kdtrace.h" #include "opt_route.h" #include #include +#include +#include +#include #include #include #include -#include #include +#include #include #include -#include -#include -#include #include +#include #include #include @@ -156,6 +158,10 @@ static int ip6_hopopts_input(u_int32_t *, u_int32_t *, struct mbuf **, int *); static struct mbuf *ip6_pullexthdr(struct mbuf *, size_t, int); #endif +SDT_PROVIDER_DECLARE(ip); + +SDT_PROBE_DECLARE(ip, , , receive); + /* * IP6 initialization: fill in IP6 protocol switch table. * All protocols not implemented in kernel go to raw IP6 protocol handler. @@ -534,6 +540,8 @@ ip6_input(struct mbuf *m) IP6STAT_INC(ip6s_nxthist[ip6->ip6_nxt]); + SDT_PROBE6(ip, , , receive, 0, 0, m, m->m_pkthdr.rcvif, 0, ip6); + /* * Check against address spoofing/corruption. */ diff --git a/sys/netinet6/ip6_mroute.c b/sys/netinet6/ip6_mroute.c index 458466a..7b9fc6a 100644 --- a/sys/netinet6/ip6_mroute.c +++ b/sys/netinet6/ip6_mroute.c @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" +#include "opt_kdtrace.h" #include #include @@ -93,6 +94,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1646,6 +1648,7 @@ phyint_send(struct ip6_hdr *ip6, struct mif6 *mifp, struct mbuf *m) * We just call if_output instead of nd6_output here, since * we need no ND for a multicast forwarded packet...right? */ + SDT_PROBE6(ip, , , send, 0, 0, mb_copy, ifp, 0, ip6); error = (*ifp->if_output)(ifp, mb_copy, (struct sockaddr *)&dst6, NULL); #ifdef MRT6DEBUG diff --git a/sys/netinet6/nd6.c b/sys/netinet6/nd6.c index 0e30825..be711fc 100644 --- a/sys/netinet6/nd6.c +++ b/sys/netinet6/nd6.c @@ -34,23 +34,25 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" +#include "opt_kdtrace.h" #include #include #include +#include +#include +#include #include #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include +#include +#include #include #include @@ -136,6 +138,10 @@ static VNET_DEFINE(struct callout, nd6_slowtimo_ch); VNET_DEFINE(struct callout, nd6_timer_ch); +SDT_PROVIDER_DECLARE(ip); + +SDT_PROBE_DECLARE(ip, , , send); + void nd6_init(void) { @@ -2061,6 +2067,7 @@ nd6_output_lle(struct ifnet *ifp, struct ifnet *origifp, struct mbuf *m0, return (error); } /* Reset layer specific mbuf flags to avoid confusing lower layers. */ + SDT_PROBE6(ip, , , send, 0, 0, m, ifp, 0, mtod(m, struct ip6_hdr *)); m->m_flags &= ~(M_PROTOFLAGS); if ((ifp->if_flags & IFF_LOOPBACK) != 0) { return ((*ifp->if_output)(origifp, m, (struct sockaddr *)dst, diff --git a/sys/netinet6/send.c b/sys/netinet6/send.c index 5624366..0830ac3 100644 --- a/sys/netinet6/send.c +++ b/sys/netinet6/send.c @@ -187,6 +187,7 @@ send_output(struct mbuf *m, struct ifnet *ifp, int direction) * XXX-BZ as we added data, what about fragmenting, * if now needed? */ + SDT_PROBE6(ip, , , send, 0, 0, m, ifp, 0, ip6); int error; error = ((*ifp->if_output)(ifp, m, (struct sockaddr *)&dst, NULL));