From 2a31e73aee69c6005768c20c418e13fa695d15f7 Mon Sep 17 00:00:00 2001 From: smh Date: Thu, 18 May 2017 03:32:01 +0000 Subject: [PATCH] Revert the partial MFC of r313045 which broke dtrace This removes the mbuf to ipinfo_t translator and switches tcp_autorcvbuf to use the older mtod macro. This was originally merged to stable/10 as part of r317375. Reported by: markj Reviewed by: markj, hiren Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D10769 git-svn-id: svn://svn.freebsd.org/base/stable/10@318438 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- cddl/lib/libdtrace/ip.d | 18 ------------------ sys/netinet/in_kdtrace.c | 12 ++++++------ sys/netinet/tcp_input.c | 3 ++- 3 files changed, 8 insertions(+), 25 deletions(-) diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d index 15dfc3447..f8fa9b168 100644 --- a/cddl/lib/libdtrace/ip.d +++ b/cddl/lib/libdtrace/ip.d @@ -240,24 +240,6 @@ translator ipinfo_t < uint8_t *p > { #pragma D binding "1.0" IFF_LOOPBACK inline int IFF_LOOPBACK = 0x8; -#pragma D binding "1.13" translator -translator ipinfo_t < struct mbuf *m > { - ip_ver = m == NULL ? 0 : ((struct ip *)m->m_data)->ip_v; - ip_plength = m == NULL ? 0 : - ((struct ip *)m->m_data)->ip_v == 4 ? - ntohs(((struct ip *)m->m_data)->ip_len) - - (((struct ip *)m->m_data)->ip_hl << 2): - ntohs(((struct ip6_hdr *)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen); - ip_saddr = m == NULL ? 0 : - ((struct ip *)m->m_data)->ip_v == 4 ? - inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) : - inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src); - ip_daddr = m == NULL ? 0 : - ((struct ip *)m->m_data)->ip_v == 4 ? - inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) : - inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst); -}; - #pragma D binding "1.0" translator translator ifinfo_t < struct ifnet *p > { if_name = p->if_xname; diff --git a/sys/netinet/in_kdtrace.c b/sys/netinet/in_kdtrace.c index d34abc521..fabfd54b2 100644 --- a/sys/netinet/in_kdtrace.c +++ b/sys/netinet/in_kdtrace.c @@ -58,28 +58,28 @@ SDT_PROBE_DEFINE6_XLATE(ip, , , send, SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__established, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "struct mbuf *", "ipinfo_t *", + "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , accept__refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "struct mbuf *", "ipinfo_t *", + "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfo_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__established, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "struct mbuf *", "ipinfo_t *", + "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__refused, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "struct mbuf *", "ipinfo_t *", + "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); @@ -93,7 +93,7 @@ SDT_PROBE_DEFINE5_XLATE(tcp, , , connect__request, SDT_PROBE_DEFINE5_XLATE(tcp, , , receive, "void *", "pktinfo_t *", "struct tcpcb *", "csinfo_t *", - "struct mbuf *", "ipinfo_t *", + "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *"); @@ -115,7 +115,7 @@ SDT_PROBE_DEFINE6_XLATE(tcp, , , state__change, SDT_PROBE_DEFINE6_XLATE(tcp, , , receive__autoresize, "void *", "void *", "struct tcpcb *", "csinfo_t *", - "struct mbuf *", "ipinfo_t *", + "uint8_t *", "ipinfo_t *", "struct tcpcb *", "tcpsinfo_t *" , "struct tcphdr *", "tcpinfoh_t *", "int", "int"); diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 95c4d53a8..125125a3b 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1519,7 +1519,8 @@ tcp_autorcvbuf(struct mbuf *m, struct tcphdr *th, struct socket *so, newsize = min(so->so_rcv.sb_hiwat + V_tcp_autorcvbuf_inc, V_tcp_autorcvbuf_max); } - TCP_PROBE6(receive__autoresize, NULL, tp, m, tp, th, newsize); + TCP_PROBE6(receive__autoresize, NULL, tp, mtod(m, const char *), + tp, th, newsize); /* Start over with next RTT. */ tp->rfbuf_ts = 0; -- 2.45.0