aboutsummaryrefslogtreecommitdiff
path: root/cddl/lib/libdtrace
diff options
context:
space:
mode:
Diffstat (limited to 'cddl/lib/libdtrace')
-rw-r--r--cddl/lib/libdtrace/Makefile30
-rw-r--r--cddl/lib/libdtrace/Makefile.depend4
-rw-r--r--cddl/lib/libdtrace/errno.d2
-rw-r--r--cddl/lib/libdtrace/io.d5
-rw-r--r--cddl/lib/libdtrace/ip.d6
-rw-r--r--cddl/lib/libdtrace/libproc_compat.h4
-rw-r--r--cddl/lib/libdtrace/net.d2
-rw-r--r--cddl/lib/libdtrace/nfs.d2
-rw-r--r--cddl/lib/libdtrace/nfssrv.d2
-rw-r--r--cddl/lib/libdtrace/psinfo.d2
-rw-r--r--cddl/lib/libdtrace/regs_aarch64.d74
-rw-r--r--cddl/lib/libdtrace/regs_riscv.d74
-rw-r--r--cddl/lib/libdtrace/regs_x86.d8
-rw-r--r--cddl/lib/libdtrace/sched.d2
-rw-r--r--cddl/lib/libdtrace/sctp.d2
-rw-r--r--cddl/lib/libdtrace/siftr.d55
-rw-r--r--cddl/lib/libdtrace/signal.d2
-rw-r--r--cddl/lib/libdtrace/socket.d2
-rw-r--r--cddl/lib/libdtrace/tcp.d63
-rw-r--r--cddl/lib/libdtrace/udp.d2
-rw-r--r--cddl/lib/libdtrace/udplite.d2
-rw-r--r--cddl/lib/libdtrace/unistd.d2
22 files changed, 244 insertions, 103 deletions
diff --git a/cddl/lib/libdtrace/Makefile b/cddl/lib/libdtrace/Makefile
index 05b183215f4c..d5c857bc06a0 100644
--- a/cddl/lib/libdtrace/Makefile
+++ b/cddl/lib/libdtrace/Makefile
@@ -1,10 +1,14 @@
-# $FreeBSD$
+
+SHLIBDIR?= /lib
+
+.include <src.opts.mk>
.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/common
.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libgen/common
PACKAGE= dtrace
LIB= dtrace
+
SRCS= dt_aggregate.c \
dt_as.c \
dt_buf.c \
@@ -84,6 +88,7 @@ CFLAGS+= -DHAVE_ISSETUGID
CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \
-I${SRCTOP}/sys/cddl/dev/dtrace/${MACHINE_ARCH} \
+ -I${SRCTOP}/sys/cddl/dev/kinst \
-I${SRCTOP}/sys/cddl/compat/opensolaris \
-I${SRCTOP}/cddl/compat/opensolaris/include \
-I${OPENSOLARIS_USR_DISTDIR}/head \
@@ -107,10 +112,6 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm
.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/arm
.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/arm
-.elif ${MACHINE_CPUARCH} == "mips"
-CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
-.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/mips
-.PATH: ${SRCTOP}/sys/cddl/dev/dtrace/mips
.elif ${MACHINE_CPUARCH} == "powerpc"
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc
.PATH: ${SRCTOP}/cddl/contrib/opensolaris/lib/libdtrace/powerpc
@@ -125,13 +126,28 @@ CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
.endif
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
-SRCS+= dis_tables.c
+SRCS+= dis_tables.c instr_size.c
DSRCS+= regs_x86.d
.endif
+.if ${MACHINE_CPUARCH} == "riscv"
+SRCS+= instr_size.c
+DSRCS+= regs_riscv.d
+.endif
+
+.if ${MACHINE_CPUARCH} == "aarch64"
+SRCS+= instr_size.c
+DSRCS+= regs_aarch64.d
+.endif
+
YFLAGS+=-d
-LIBADD= ctf elf proc pthread rtld_db
+.if ${MK_DTRACE_ASAN} != "no"
+CFLAGS+= -fsanitize=address -fsanitize=undefined
+LDFLAGS+= -fsanitize=address -fsanitize=undefined
+.endif
+
+LIBADD= ctf elf proc pthread rtld_db xo
CLEANFILES= dt_errtags.c dt_names.c
diff --git a/cddl/lib/libdtrace/Makefile.depend b/cddl/lib/libdtrace/Makefile.depend
index 68a8d3e9c520..92c6b0e658b5 100644
--- a/cddl/lib/libdtrace/Makefile.depend
+++ b/cddl/lib/libdtrace/Makefile.depend
@@ -1,9 +1,8 @@
-# $FreeBSD$
# Autogenerated - do NOT edit!
DIRDEPS = \
+ bin/sh.host \
cddl/lib/libctf \
- gnu/lib/csu \
include \
include/arpa \
include/xlocale \
@@ -14,6 +13,7 @@ DIRDEPS = \
lib/libproc \
lib/librtld_db \
lib/libthr \
+ usr.bin/awk.host \
usr.bin/yacc.host \
diff --git a/cddl/lib/libdtrace/errno.d b/cddl/lib/libdtrace/errno.d
index 426d882b0db1..2045e3a7433d 100644
--- a/cddl/lib/libdtrace/errno.d
+++ b/cddl/lib/libdtrace/errno.d
@@ -21,8 +21,6 @@
*
* Portions Copyright 2006-2008 John Birrell jb@freebsd.org
* Portions Copyright 2018 Devin Teske dteske@freebsd.org
- *
- * $FreeBSD$
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
diff --git a/cddl/lib/libdtrace/io.d b/cddl/lib/libdtrace/io.d
index d643ad732a94..d576f57476ce 100644
--- a/cddl/lib/libdtrace/io.d
+++ b/cddl/lib/libdtrace/io.d
@@ -19,8 +19,6 @@
* CDDL HEADER END
*
* Portions Copyright 2018 Devin Teske dteske@freebsd.org
- *
- * $FreeBSD$
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
@@ -196,6 +194,8 @@ inline int DEVSTAT_TYPE_IF_IDE = 0x020;
#pragma D binding "1.13" DEVSTAT_TYPE_IF_IDE
inline int DEVSTAT_TYPE_IF_OTHER = 0x030;
#pragma D binding "1.13" DEVSTAT_TYPE_IF_OTHER
+inline int DEVSTAT_TYPE_IF_NVME = 0x040;
+#pragma D binding "1.13" DEVSTAT_TYPE_IF_NVME
inline int DEVSTAT_TYPE_IF_MASK = 0x0f0;
#pragma D binding "1.13" DEVSTAT_TYPE_IF_MASK
inline int DEVSTAT_TYPE_PASS = 0x100;
@@ -230,6 +230,7 @@ inline string device_if_string[int type] =
type == DEVSTAT_TYPE_IF_SCSI ? "SCSI" :
type == DEVSTAT_TYPE_IF_IDE ? "IDE" :
type == DEVSTAT_TYPE_IF_OTHER ? "OTHER" :
+ type == DEVSTAT_TYPE_IF_NVME ? "NVME" :
strjoin("UNKNOWN(", strjoin(lltostr(type), ")"));
#pragma D binding "1.13" device_if
diff --git a/cddl/lib/libdtrace/ip.d b/cddl/lib/libdtrace/ip.d
index f591a965af68..2fe98858efc2 100644
--- a/cddl/lib/libdtrace/ip.d
+++ b/cddl/lib/libdtrace/ip.d
@@ -17,8 +17,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
@@ -264,8 +262,8 @@ inline int IFF_LOOPBACK = 0x8;
#pragma D binding "1.5" translator
translator ifinfo_t < struct ifnet *p > {
- if_name = p->if_xname;
- if_local = (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1;
+ if_name = p == NULL ? "<unknown>" : p->if_xname;
+ if_local = p == NULL ? 0 : (p->if_flags & IFF_LOOPBACK) == 0 ? 0 : 1;
if_addr = (uintptr_t)p;
};
diff --git a/cddl/lib/libdtrace/libproc_compat.h b/cddl/lib/libdtrace/libproc_compat.h
index 14f32506bb8f..7cdc8af18b56 100644
--- a/cddl/lib/libdtrace/libproc_compat.h
+++ b/cddl/lib/libdtrace/libproc_compat.h
@@ -25,8 +25,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
/*
@@ -58,10 +56,8 @@
#define Prd_agent proc_rdagent
#define Prelease proc_detach
#define Psetbkpt proc_bkptset
-#define Psetflags proc_setflags
#define Pstate proc_state
#define Psymbol_iter_by_addr proc_iter_symbyaddr
-#define Punsetflags proc_clearflags
#define Pupdate_maps proc_rdagent
#define Pupdate_syms proc_updatesyms
#define Pxecbkpt proc_bkptexec
diff --git a/cddl/lib/libdtrace/net.d b/cddl/lib/libdtrace/net.d
index ee22c8ffb0cc..fef61ea31f4b 100644
--- a/cddl/lib/libdtrace/net.d
+++ b/cddl/lib/libdtrace/net.d
@@ -19,8 +19,6 @@
* CDDL HEADER END
*
* Portions Copyright 2006-2008 John Birrell jb@freebsd.org
- *
- * $FreeBSD$
*/
/*
diff --git a/cddl/lib/libdtrace/nfs.d b/cddl/lib/libdtrace/nfs.d
index ae864ed363d2..4d55b39a809d 100644
--- a/cddl/lib/libdtrace/nfs.d
+++ b/cddl/lib/libdtrace/nfs.d
@@ -19,8 +19,6 @@
* CDDL HEADER END
*
* Portions Copyright 2006-2008 John Birrell jb@freebsd.org
- *
- * $FreeBSD$
*/
/*
diff --git a/cddl/lib/libdtrace/nfssrv.d b/cddl/lib/libdtrace/nfssrv.d
index 37842f7963a1..b5231bf7a2ec 100644
--- a/cddl/lib/libdtrace/nfssrv.d
+++ b/cddl/lib/libdtrace/nfssrv.d
@@ -19,8 +19,6 @@
* CDDL HEADER END
*
* Portions Copyright 2006-2008 John Birrell jb@freebsd.org
- *
- * $FreeBSD$
*/
/*
diff --git a/cddl/lib/libdtrace/psinfo.d b/cddl/lib/libdtrace/psinfo.d
index 0f5ca63c39a4..c0cd5b121064 100644
--- a/cddl/lib/libdtrace/psinfo.d
+++ b/cddl/lib/libdtrace/psinfo.d
@@ -20,8 +20,6 @@
* CDDL HEADER END
*
* Portions Copyright 2006 John Birrell jb@freebsd.org
- *
- * $FreeBSD$
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
diff --git a/cddl/lib/libdtrace/regs_aarch64.d b/cddl/lib/libdtrace/regs_aarch64.d
new file mode 100644
index 000000000000..7d20b5c546c5
--- /dev/null
+++ b/cddl/lib/libdtrace/regs_aarch64.d
@@ -0,0 +1,74 @@
+/*
+ * SPDX-License-Identifier: CDDL 1.0
+ *
+ * Copyright 2023 Christos Margiolis <christos@FreeBSD.org>
+ */
+
+inline int R_X0 = 0;
+#pragma D binding "1.13" R_X0
+inline int R_X1 = 1;
+#pragma D binding "1.13" R_X1
+inline int R_X2 = 2;
+#pragma D binding "1.13" R_X2
+inline int R_X3 = 3;
+#pragma D binding "1.13" R_X3
+inline int R_X4 = 4;
+#pragma D binding "1.13" R_X4
+inline int R_X5 = 5;
+#pragma D binding "1.13" R_X5
+inline int R_X6 = 6;
+#pragma D binding "1.13" R_X6
+inline int R_X7 = 7;
+#pragma D binding "1.13" R_X7
+inline int R_X8 = 8;
+#pragma D binding "1.13" R_X8
+inline int R_X9 = 9;
+#pragma D binding "1.13" R_X9
+inline int R_X10 = 10;
+#pragma D binding "1.13" R_X10
+inline int R_X11 = 11;
+#pragma D binding "1.13" R_X11
+inline int R_X12 = 12;
+#pragma D binding "1.13" R_X12
+inline int R_X13 = 13;
+#pragma D binding "1.13" R_X13
+inline int R_X14 = 14;
+#pragma D binding "1.13" R_X14
+inline int R_X15 = 15;
+#pragma D binding "1.13" R_X15
+inline int R_X16 = 16;
+#pragma D binding "1.13" R_X16
+inline int R_X17 = 17;
+#pragma D binding "1.13" R_X17
+inline int R_X18 = 18;
+#pragma D binding "1.13" R_X18
+inline int R_X19 = 19;
+#pragma D binding "1.13" R_X19
+inline int R_X20 = 20;
+#pragma D binding "1.13" R_X20
+inline int R_X21 = 21;
+#pragma D binding "1.13" R_X21
+inline int R_X22 = 22;
+#pragma D binding "1.13" R_X22
+inline int R_X23 = 23;
+#pragma D binding "1.13" R_X23
+inline int R_X24 = 24;
+#pragma D binding "1.13" R_X24
+inline int R_X25 = 25;
+#pragma D binding "1.13" R_X25
+inline int R_X26 = 26;
+#pragma D binding "1.13" R_X26
+inline int R_X27 = 27;
+#pragma D binding "1.13" R_X27
+inline int R_X28 = 28;
+#pragma D binding "1.13" R_X28
+inline int R_X29 = 29;
+#pragma D binding "1.13" R_X29
+inline int R_FP= 29;
+#pragma D binding "1.13" R_FP
+inline int R_LR = 30;
+#pragma D binding "1.13" R_LR
+inline int R_SP = 31;
+#pragma D binding "1.13" R_SP
+inline int R_PC = 32;
+#pragma D binding "1.13" R_PC
diff --git a/cddl/lib/libdtrace/regs_riscv.d b/cddl/lib/libdtrace/regs_riscv.d
new file mode 100644
index 000000000000..e8a9667d2efd
--- /dev/null
+++ b/cddl/lib/libdtrace/regs_riscv.d
@@ -0,0 +1,74 @@
+/*
+ * SPDX-License-Identifier: CDDL 1.0
+ *
+ * Copyright 2023 Christos Margiolis <christos@FreeBSD.org>
+ */
+
+inline int R_ZERO = 0;
+#pragma D binding "1.13" R_ZERO
+inline int R_RA = 1;
+#pragma D binding "1.13" R_RA
+inline int R_SP = 2;
+#pragma D binding "1.13" R_SP
+inline int R_GP = 3;
+#pragma D binding "1.13" R_GP
+inline int R_TP = 4;
+#pragma D binding "1.13" R_TP
+inline int R_T0 = 5;
+#pragma D binding "1.13" R_T0
+inline int R_T1 = 6;
+#pragma D binding "1.13" R_T1
+inline int R_T2 = 7;
+#pragma D binding "1.13" R_T2
+inline int R_S0 = 8;
+#pragma D binding "1.13" R_S0
+inline int R_FP = 8;
+#pragma D binding "1.13" R_FP
+inline int R_S1 = 9;
+#pragma D binding "1.13" R_S1
+inline int R_A0 = 10;
+#pragma D binding "1.13" R_A0
+inline int R_A1 = 11;
+#pragma D binding "1.13" R_A1
+inline int R_A2 = 12;
+#pragma D binding "1.13" R_A2
+inline int R_A3 = 13;
+#pragma D binding "1.13" R_A3
+inline int R_A4 = 14;
+#pragma D binding "1.13" R_A4
+inline int R_A5 = 15;
+#pragma D binding "1.13" R_A5
+inline int R_A6 = 16;
+#pragma D binding "1.13" R_A6
+inline int R_A7 = 17;
+#pragma D binding "1.13" R_A7
+inline int R_S2 = 18;
+#pragma D binding "1.13" R_S2
+inline int R_S3 = 19;
+#pragma D binding "1.13" R_S3
+inline int R_S4 = 20;
+#pragma D binding "1.13" R_S4
+inline int R_S5 = 21;
+#pragma D binding "1.13" R_S5
+inline int R_S6 = 22;
+#pragma D binding "1.13" R_S6
+inline int R_S7 = 23;
+#pragma D binding "1.13" R_S7
+inline int R_S8 = 24;
+#pragma D binding "1.13" R_S8
+inline int R_S9 = 25;
+#pragma D binding "1.13" R_S9
+inline int R_S10 = 26;
+#pragma D binding "1.13" R_S10
+inline int R_S11 = 27;
+#pragma D binding "1.13" R_S11
+inline int R_T3 = 28;
+#pragma D binding "1.13" R_T3
+inline int R_T4 = 29;
+#pragma D binding "1.13" R_T4
+inline int R_T5 = 30;
+#pragma D binding "1.13" R_T5
+inline int R_T6 = 31;
+#pragma D binding "1.13" R_T6
+inline int R_PC = 32;
+#pragma D binding "1.13" R_PC
diff --git a/cddl/lib/libdtrace/regs_x86.d b/cddl/lib/libdtrace/regs_x86.d
index 3f625f9f4445..2e31517fdd8d 100644
--- a/cddl/lib/libdtrace/regs_x86.d
+++ b/cddl/lib/libdtrace/regs_x86.d
@@ -20,8 +20,6 @@
* CDDL HEADER END
*
* Portions Copyright 2009 Stacey Son sson@FreeBSD.org
- *
- * $FreeBSD$
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
@@ -80,11 +78,11 @@ inline int R_R0 = R_EAX;
inline int R_R1 = R_EBX;
#pragma D binding "1.0" R_R1
-inline int R_RSP = 18 + 1 + 20;
+inline int R_RSP = 18 + 1 + 24;
#pragma D binding "1.0" R_RSP
-inline int R_RFL = 18 + 1 + 19;
+inline int R_RFL = 18 + 1 + 23;
#pragma D binding "1.0" R_RFL
-inline int R_RIP = 18 + 1 + 17;
+inline int R_RIP = 18 + 1 + 21;
#pragma D binding "1.0" R_RIP
inline int R_RAX = 18 + 1 + 14;
#pragma D binding "1.0" R_RAX
diff --git a/cddl/lib/libdtrace/sched.d b/cddl/lib/libdtrace/sched.d
index 82fdf3ab0c05..7eca118fc428 100644
--- a/cddl/lib/libdtrace/sched.d
+++ b/cddl/lib/libdtrace/sched.d
@@ -19,8 +19,6 @@
* CDDL HEADER END
*
* Portions Copyright 2006-2008 John Birrell jb@freebsd.org
- *
- * $FreeBSD$
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
diff --git a/cddl/lib/libdtrace/sctp.d b/cddl/lib/libdtrace/sctp.d
index 5dc776bdb971..ef8c3bcc4a56 100644
--- a/cddl/lib/libdtrace/sctp.d
+++ b/cddl/lib/libdtrace/sctp.d
@@ -17,8 +17,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
/*
* Copyright (c) 2018 Michael Tuexen <tuexen@FreeBSD.org>
diff --git a/cddl/lib/libdtrace/siftr.d b/cddl/lib/libdtrace/siftr.d
index 37bc30ff3e06..bca3a0f0df7f 100644
--- a/cddl/lib/libdtrace/siftr.d
+++ b/cddl/lib/libdtrace/siftr.d
@@ -17,10 +17,9 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
+#pragma D depends_on library ip.d
#pragma D depends_on module kernel
#pragma D depends_on module siftr
#pragma D depends_on provider tcp
@@ -29,9 +28,9 @@
* Convert a SIFTR direction value to a string
*/
#pragma D binding "1.12.1" SIFTR_IN
-inline int SIFTR_IN = 1;
+inline int SIFTR_IN = 0;
#pragma D binding "1.12.1" SIFTR_OUT
-inline int SIFTR_OUT = 2;
+inline int SIFTR_OUT = 1;
/* SIFTR direction strings. */
#pragma D binding "1.12.1" siftr_dir_string
@@ -44,22 +43,23 @@ typedef struct siftrinfo {
struct timeval tval;
uint8_t direction;
uint8_t ipver;
- uint32_t hash;
- uint16_t tcp_localport;
- uint16_t tcp_foreignport;
- uint64_t snd_cwnd;
- u_long snd_wnd;
- u_long rcv_wnd;
- u_long snd_bwnd;
- u_long snd_ssthresh;
+ uint16_t lport;
+ uint16_t rport;
+ string laddr;
+ string raddr;
+ uint32_t snd_cwnd;
+ uint32_t snd_wnd;
+ uint32_t rcv_wnd;
+ uint32_t t_flags2;
+ uint32_t snd_ssthresh;
int conn_state;
- u_int max_seg_size;
- int smoothed_rtt;
+ uint32_t mss;
+ uint32_t srtt;
u_char sack_enabled;
u_char snd_scale;
u_char rcv_scale;
- u_int flags;
- int rxt_length;
+ u_int t_flags;
+ uint32_t rto;
u_int snd_buf_hiwater;
u_int snd_buf_cc;
u_int rcv_buf_hiwater;
@@ -74,22 +74,29 @@ typedef struct siftrinfo {
translator siftrinfo_t < struct pkt_node *p > {
direction = p == NULL ? 0 : p->direction;
ipver = p == NULL ? 0 : p->ipver;
- hash = p == NULL ? 0 : p->hash;
- tcp_localport = p == NULL ? 0 : ntohs(p->tcp_localport);
- tcp_foreignport = p == NULL ? 0 : ntohs(p->tcp_foreignport);
+ lport = p == NULL ? 0 : ntohs(p->lport);
+ rport = p == NULL ? 0 : ntohs(p->fport);
+ laddr = p == NULL ? "<unknown>" :
+ p->ipver == INP_IPV4 ?
+ inet_ntoa(&p->laddr.id46_addr.ia46_addr4.s_addr) :
+ inet_ntoa6(&p->laddr.id6_addr);
+ raddr = p == NULL ? "<unknown>" :
+ p->ipver == INP_IPV4 ?
+ inet_ntoa(&p->faddr.id46_addr.ia46_addr4.s_addr) :
+ inet_ntoa6(&p->faddr.id6_addr);
snd_cwnd = p == NULL ? 0 : p->snd_cwnd;
snd_wnd = p == NULL ? 0 : p->snd_wnd;
rcv_wnd = p == NULL ? 0 : p->rcv_wnd;
- snd_bwnd = p == NULL ? 0 : p->snd_bwnd;
+ t_flags2 = p == NULL ? 0 : p->t_flags2;
snd_ssthresh = p == NULL ? 0 : p->snd_ssthresh;
conn_state = p == NULL ? 0 : p->conn_state;
- max_seg_size = p == NULL ? 0 : p->max_seg_size;
- smoothed_rtt = p == NULL ? 0 : p->smoothed_rtt;
+ mss = p == NULL ? 0 : p->mss;
+ srtt = p == NULL ? 0 : p->srtt;
sack_enabled = p == NULL ? 0 : p->sack_enabled;
snd_scale = p == NULL ? 0 : p->snd_scale;
rcv_scale = p == NULL ? 0 : p->rcv_scale;
- flags = p == NULL ? 0 : p->flags;
- rxt_length = p == NULL ? 0 : p->rxt_length;
+ t_flags = p == NULL ? 0 : p->t_flags;
+ rto = p == NULL ? 0 : p->rto;
snd_buf_hiwater = p == NULL ? 0 : p->snd_buf_hiwater;
snd_buf_cc = p == NULL ? 0 : p->snd_buf_cc;
rcv_buf_hiwater = p == NULL ? 0 : p->rcv_buf_hiwater;
diff --git a/cddl/lib/libdtrace/signal.d b/cddl/lib/libdtrace/signal.d
index cdd433883397..0f9b2567cc0d 100644
--- a/cddl/lib/libdtrace/signal.d
+++ b/cddl/lib/libdtrace/signal.d
@@ -21,8 +21,6 @@
*
* Portions Copyright 2008 John Birrell jb@freebsd.org
* Portions Copyright 2018 Devin Teske dteske@freebsd.org
- *
- * $FreeBSD$
*/
inline int SIGHUP = 1;
diff --git a/cddl/lib/libdtrace/socket.d b/cddl/lib/libdtrace/socket.d
index da8f149b2d10..c8161f9b2d30 100644
--- a/cddl/lib/libdtrace/socket.d
+++ b/cddl/lib/libdtrace/socket.d
@@ -23,8 +23,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD$
- *
* Translators and flags for the socket structure. FreeBSD specific code.
*/
diff --git a/cddl/lib/libdtrace/tcp.d b/cddl/lib/libdtrace/tcp.d
index afcfdfadaf1e..0df4e16d41d0 100644
--- a/cddl/lib/libdtrace/tcp.d
+++ b/cddl/lib/libdtrace/tcp.d
@@ -17,8 +17,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
@@ -83,21 +81,23 @@ inline int TCP_STATE_TIME_WAIT = TCPS_TIME_WAIT;
/* TCP segment flags. */
#pragma D binding "1.6.3" TH_FIN
-inline uint8_t TH_FIN = 0x01;
+inline uint16_t TH_FIN = 0x01;
#pragma D binding "1.6.3" TH_SYN
-inline uint8_t TH_SYN = 0x02;
+inline uint16_t TH_SYN = 0x02;
#pragma D binding "1.6.3" TH_RST
-inline uint8_t TH_RST = 0x04;
+inline uint16_t TH_RST = 0x04;
#pragma D binding "1.6.3" TH_PUSH
-inline uint8_t TH_PUSH = 0x08;
+inline uint16_t TH_PUSH = 0x08;
#pragma D binding "1.6.3" TH_ACK
-inline uint8_t TH_ACK = 0x10;
+inline uint16_t TH_ACK = 0x10;
#pragma D binding "1.6.3" TH_URG
-inline uint8_t TH_URG = 0x20;
+inline uint16_t TH_URG = 0x20;
#pragma D binding "1.6.3" TH_ECE
-inline uint8_t TH_ECE = 0x40;
+inline uint16_t TH_ECE = 0x40;
#pragma D binding "1.6.3" TH_CWR
-inline uint8_t TH_CWR = 0x80;
+inline uint16_t TH_CWR = 0x80;
+#pragma D binding "1.6.3" TH_AE
+inline uint16_t TH_AE = 0x100;
/* TCP connection state strings. */
#pragma D binding "1.6.3" tcp_state_string
@@ -175,7 +175,7 @@ typedef struct tcpinfo {
uint32_t tcp_seq; /* sequence number */
uint32_t tcp_ack; /* acknowledgment number */
uint8_t tcp_offset; /* data offset, in bytes */
- uint8_t tcp_flags; /* flags */
+ uint16_t tcp_flags; /* flags */
uint16_t tcp_window; /* window size */
uint16_t tcp_checksum; /* checksum */
uint16_t tcp_urgent; /* urgent data pointer */
@@ -194,7 +194,7 @@ typedef struct tcpinfoh {
uint32_t tcp_seq; /* sequence number */
uint32_t tcp_ack; /* acknowledgment number */
uint8_t tcp_offset; /* data offset, in bytes */
- uint8_t tcp_flags; /* flags */
+ uint16_t tcp_flags; /* flags */
uint16_t tcp_window; /* window size */
uint16_t tcp_checksum; /* checksum */
uint16_t tcp_urgent; /* urgent data pointer */
@@ -204,7 +204,7 @@ typedef struct tcpinfoh {
#pragma D binding "1.6.3" translator
translator csinfo_t < struct tcpcb *p > {
cs_addr = NULL;
- cs_cid = (uint64_t)(p == NULL ? 0 : p->t_inpcb);
+ cs_cid = (uint64_t)(p == NULL ? 0 : &p->t_inpcb);
cs_pid = 0;
cs_zoneid = 0;
};
@@ -214,16 +214,16 @@ translator tcpsinfo_t < struct tcpcb *p > {
tcps_addr = (uintptr_t)p;
tcps_local = -1; /* XXX */
tcps_active = -1; /* XXX */
- tcps_lport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_lport);
- tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport);
+ tcps_lport = p == NULL ? 0 : ntohs(p->t_inpcb.inp_inc.inc_ie.ie_lport);
+ tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb.inp_inc.inc_ie.ie_fport);
tcps_laddr = p == NULL ? "<unknown>" :
- p->t_inpcb->inp_vflag == INP_IPV4 ?
- inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) :
- inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr);
+ p->t_inpcb.inp_vflag == INP_IPV4 ?
+ inet_ntoa(&p->t_inpcb.inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) :
+ inet_ntoa6(&p->t_inpcb.inp_inc.inc_ie.ie_dependladdr.id6_addr);
tcps_raddr = p == NULL ? "<unknown>" :
- p->t_inpcb->inp_vflag == INP_IPV4 ?
- inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) :
- inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr);
+ p->t_inpcb.inp_vflag == INP_IPV4 ?
+ inet_ntoa(&p->t_inpcb.inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) :
+ inet_ntoa6(&p->t_inpcb.inp_inc.inc_ie.ie_dependfaddr.id6_addr);
tcps_state = p == NULL ? -1 : p->t_state;
tcps_iss = p == NULL ? 0 : p->iss;
tcps_irs = p == NULL ? 0 : p->irs;
@@ -250,9 +250,9 @@ translator tcpsinfo_t < struct tcpcb *p > {
tcps_retransmit = p == NULL ? -1 : p->t_rxtshift > 0 ? 1 : 0;
tcps_srtt = p == NULL ? -1 : p->t_srtt; /* smoothed RTT in units of (TCP_RTT_SCALE*hz) */
tcps_debug = p == NULL ? 0 :
- p->t_inpcb->inp_socket->so_options & 1;
+ p->t_inpcb.inp_socket->so_options & 1;
tcps_cookie = p == NULL ? -1 :
- p->t_inpcb->inp_socket->so_user_cookie;
+ p->t_inpcb.inp_socket->so_user_cookie;
tcps_dupacks = p == NULL ? -1 : p->t_dupacks;
tcps_rtttime = p == NULL ? -1 : p->t_rtttime;
tcps_rtseq = p == NULL ? -1 : p->t_rtseq;
@@ -265,8 +265,8 @@ translator tcpinfo_t < struct tcphdr *p > {
tcp_dport = p == NULL ? 0 : ntohs(p->th_dport);
tcp_seq = p == NULL ? -1 : ntohl(p->th_seq);
tcp_ack = p == NULL ? -1 : ntohl(p->th_ack);
- tcp_offset = p == NULL ? -1 : (p->th_off >> 2);
- tcp_flags = p == NULL ? 0 : p->th_flags;
+ tcp_offset = p == NULL ? -1 : (p->th_off << 2);
+ tcp_flags = p == NULL ? 0 : ((p->th_x2 << 8) | p->th_flags);
tcp_window = p == NULL ? 0 : ntohs(p->th_win);
tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum);
tcp_urgent = p == NULL ? 0 : ntohs(p->th_urp);
@@ -284,8 +284,8 @@ translator tcpinfoh_t < struct tcphdr *p > {
tcp_dport = p == NULL ? 0 : ntohs(p->th_dport);
tcp_seq = p == NULL ? -1 : p->th_seq;
tcp_ack = p == NULL ? -1 : p->th_ack;
- tcp_offset = p == NULL ? -1 : (p->th_off >> 2);
- tcp_flags = p == NULL ? 0 : p->th_flags;
+ tcp_offset = p == NULL ? -1 : (p->th_off << 2);
+ tcp_flags = p == NULL ? 0 : ((p->th_x2 << 8) | p->th_flags);
tcp_window = p == NULL ? 0 : p->th_win;
tcp_checksum = p == NULL ? 0 : ntohs(p->th_sum);
tcp_urgent = p == NULL ? 0 : p->th_urp;
@@ -313,17 +313,17 @@ inline int TA_DROP = 4;
/* direction strings. */
-#pragma D binding "1.12.1" tcpdebug_dir_string
+#pragma D binding "1.13" tcpdebug_dir_string
inline string tcpdebug_dir_string[uint8_t direction] =
direction == TA_INPUT ? "input" :
direction == TA_OUTPUT ? "output" :
direction == TA_USER ? "user" :
direction == TA_RESPOND ? "respond" :
- direction == TA_OUTPUT ? "drop" :
+ direction == TA_DROP ? "drop" :
"unknown" ;
-#pragma D binding "1.12.1" tcpflag_string
-inline string tcpflag_string[uint8_t flags] =
+#pragma D binding "1.13" tcpflag_string
+inline string tcpflag_string[uint16_t flags] =
flags & TH_FIN ? "FIN" :
flags & TH_SYN ? "SYN" :
flags & TH_RST ? "RST" :
@@ -332,6 +332,7 @@ inline string tcpflag_string[uint8_t flags] =
flags & TH_URG ? "URG" :
flags & TH_ECE ? "ECE" :
flags & TH_CWR ? "CWR" :
+ flags & TH_AE ? "AE" :
"unknown" ;
#pragma D binding "1.12.1" PRU_ATTACH
diff --git a/cddl/lib/libdtrace/udp.d b/cddl/lib/libdtrace/udp.d
index 603bbbd29617..fd28f5e2e7e9 100644
--- a/cddl/lib/libdtrace/udp.d
+++ b/cddl/lib/libdtrace/udp.d
@@ -17,8 +17,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
diff --git a/cddl/lib/libdtrace/udplite.d b/cddl/lib/libdtrace/udplite.d
index e41a6faa36a8..88c1c8553ce5 100644
--- a/cddl/lib/libdtrace/udplite.d
+++ b/cddl/lib/libdtrace/udplite.d
@@ -17,8 +17,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
diff --git a/cddl/lib/libdtrace/unistd.d b/cddl/lib/libdtrace/unistd.d
index 1ceffef2b215..ead9d23ce670 100644
--- a/cddl/lib/libdtrace/unistd.d
+++ b/cddl/lib/libdtrace/unistd.d
@@ -17,8 +17,6 @@
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
- *
- * $FreeBSD$
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.