1 .\" Copyright (c) 2018 Devin Teske <dteske@FreeBSD.org>
3 .\" Redistribution and use in source and binary forms, with or without
4 .\" modification, are permitted provided that the following conditions
6 .\" 1. Redistributions of source code must retain the above copyright
7 .\" notice, this list of conditions and the following disclaimer.
8 .\" 2. Redistributions in binary form must reproduce the above copyright
9 .\" notice, this list of conditions and the following disclaimer in the
10 .\" documentation and/or other materials provided with the distribution.
12 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 .Nd a DTrace provider for tracing events related to the
35 .Fn sctp:cwnd::init uint32_t uint32_t uintptr_t int int
36 .Fn sctp:cwnd::ack uint32_t uint32_t uintptr_t int int
37 .Fn sctp:cwnd::rttvar uint64_t uint64_t uint64_t uint64_t uint64_t
38 .Fn sctp:cwnd::rttstep uint64_t uint64_t uint64_t uint64_t uint64_t
39 .Fn sctp:cwnd::fr uint32_t uint32_t uintptr_t int int
40 .Fn sctp:cwnd::to uint32_t uint32_t uintptr_t int int
41 .Fn sctp:cwnd::bl uint32_t uint32_t uintptr_t int int
42 .Fn sctp:cwnd::ecn uint32_t uint32_t uintptr_t int int
43 .Fn sctp:cwnd::pd uint32_t uint32_t uintptr_t int int
44 .Fn sctp:rwnd:assoc:val uint32_t uint32_t int int
45 .Fn sctp:flightsize:net:val uint32_t uint32_t uintptr_t int int
46 .Fn sctp:flightsize:assoc:val uint32_t uint32_t int int
47 .Fn sctp:::receive "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "sctpsinfo_t *" \
49 .Fn sctp:::send "pktinfo_t *" "csinfo_t *" "ipinfo_t *" "sctpsinfo_t *" \
51 .Fn sctp:::state-change "void *" "csinfo_t *" "void *" "sctpsinfo_t *" \
52 "void *" "sctplsinfo_t *"
56 provider allows users to trace events in the
58 protocol implementation.
59 This provider is similar to the
64 but additionally contains probes corresponding to protocol events at a level
65 higher than packet reception and transmission.
69 probes track changes in the congestion window on a netp.
72 probes track changes in the receiver window for an assoc.
74 .Fn sctp:flightsize:net:val
75 probe tracks changes in the flight size on a net or assoc and the
76 .Fn sctp:flightsize:assoc:val
77 probe provides the total flight version.
85 are the Vtag for this end,
86 the port number of the local side,
88 .Dv struct sctp_nets *changing ,
89 the old value of the cwnd,
90 and the new value of the cwnd.
94 are similar to the above except the fourth argument is the up/down amount.
98 probe arguments are a bitmap of
99 .Dv Vtag << 32 | localport << 16 | remoteport ,
106 .Dv (cwnd << 32) | point << 16 | retval(0/1) .
110 probe fires when a remotely-initiated active SCTP open succeeds.
111 At this point the new connection is in the ESTABLISHED state, and the probe
112 arguments expose the headers associated with the final ACK of the four-way
119 probes fire when the host sends or receives an SCTP packet, respectively.
124 probes fire only for packets sent by or to the local host; forwarded packets are
125 handled in the IP layer and are only visible to the
130 .Fn sctp:::state-change
131 probe fires upon local SCTP association state transitions.
132 Its first, third and fifth arguments are currently always
134 Its last argument describes the from-state in the transition, and the to-state
136 .Dv args[3]->sctps_state .
139 .Bl -tag -width "/usr/lib/dtrace/sctp.d" -compact
140 .It Pa /usr/lib/dtrace/sctp.d
141 DTrace type and translator definitions for the
146 A script that logs SCTP packets in real time:
147 .Bd -literal -offset indent
148 #pragma D option quiet
149 #pragma D option switchrate=10hz
153 printf(" %3s %15s:%-5s %15s:%-5s\n", "CPU",
154 "LADDR", "LPORT", "RADDR", "RPORT");
159 printf(" %3d %16s:%-5d -> %16s:%-5d\n", cpu,
160 args[2]->ip_saddr, args[4]->sctp_sport,
161 args[2]->ip_daddr, args[4]->sctp_dport);
166 printf(" %3d %16s:%-5d <- %16s:%-5d\n", cpu,
167 args[2]->ip_daddr, args[4]->sctp_dport,
168 args[2]->ip_saddr, args[4]->sctp_sport);
171 A script that logs SCTP association state changes as they occur:
172 .Bd -literal -offset indent
173 #pragma D option quiet
174 #pragma D option switchrate=10
180 printf(" %3s %12s %-25s %-25s\n",
181 "CPU", "DELTA(us)", "OLD", "NEW");
185 / last[args[1]->cs_cid] /
187 this->elapsed = (timestamp - last[args[1]->cs_cid]) / 1000;
188 printf(" %3d %12d %-25s -> %-25s\n", cpu, this->elapsed,
189 sctp_state_string[args[5]->sctps_state],
190 sctp_state_string[args[3]->sctps_state]);
191 last[args[1]->cs_cid] = timestamp;
195 / last[args[1]->cs_cid] == 0 /
197 printf(" %3d %12s %-25s -> %-25s\n", cpu, "-",
198 sctp_state_string[args[5]->sctps_state],
199 sctp_state_string[args[3]->sctps_state]);
200 last[args[1]->cs_cid] = timestamp;
208 .Fn sctp:::state-change
209 probes are compatible with the
212 All other probes are only available in FreeBSD.
217 .Xr dtrace_udplite 4 ,
223 .\" provider first appeared in
227 This manual page was written by
228 .An Devin Teske Aq Mt dteske@FreeBSD.org .