public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: eugene.loh@oracle.com
To: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: [PATCH 18/20] doc: Add TCP provider documentation
Date: Fri, 26 Sep 2025 15:05:55 -0400	[thread overview]
Message-ID: <20250926190557.8485-18-eugene.loh@oracle.com> (raw)
In-Reply-To: <20250926190557.8485-1-eugene.loh@oracle.com>

From: Eugene Loh <eugene.loh@oracle.com>

Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
---
 doc/userguide/index.md                        |   7 +
 doc/userguide/reference/dtrace_providers.md   |   2 +
 .../reference/dtrace_providers_tcp.md         | 128 ++++++++++++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 doc/userguide/reference/dtrace_providers_tcp.md

diff --git a/doc/userguide/index.md b/doc/userguide/index.md
index 18b9bcd68..d47df094b 100644
--- a/doc/userguide/index.md
+++ b/doc/userguide/index.md
@@ -259,6 +259,13 @@
         -   [syscall Probes](reference/dtrace_providers_syscall.md#syscall-probes)
         -   [syscall Probe Arguments](reference/dtrace_providers_syscall.md#syscall-probe-arguments)
         -   [syscall Stability](reference/dtrace_providers_syscall.md#syscall-stability)
+    -   [TCP Provider](reference/dtrace_providers_tcp.md)
+        -   [tcp Probes](reference/dtrace_providers_tcp.md#tcp-probes)
+        -   [tcp Probe Arguments](reference/dtrace_providers_tcp.md#tcp-probe-arguments)
+            -   [tcpinfo\_t](reference/dtrace_providers_tcp.md#tcpinfo_t)
+            -   [tcpsinfo\_t](reference/dtrace_providers_tcp.md#tcpsinfo_t)
+            -   [tcplsinfo\_t](reference/dtrace_providers_tcp.md#tcplsinfo_t)
+        -   [tcp Stability](reference/dtrace_providers_tcp.md#tcp-stability)
     -   [USDT Provider](reference/dtrace-ref-StaticallyDefinedTracingofUserApplications.md)
         -   [Defining USDT Providers and Probes](reference/dtrace-ref-StaticallyDefinedTracingofUserApplications.md#defining-usdt-providers-and-probes)
         -   [Adding USDT Probes to Application Code](reference/dtrace-ref-StaticallyDefinedTracingofUserApplications.md#adding-usdt-probes-to-application-code)
diff --git a/doc/userguide/reference/dtrace_providers.md b/doc/userguide/reference/dtrace_providers.md
index 54a018d5c..029f62c54 100644
--- a/doc/userguide/reference/dtrace_providers.md
+++ b/doc/userguide/reference/dtrace_providers.md
@@ -29,5 +29,7 @@ The `sched` provider makes available probes related to CPU scheduling.
 The Statically Defined Tracing \(SDT\) provider \(`sdt`\) creates probes at sites that a software programmer has formally designated. Thus, the SDT provider is chiefly of interest only to developers of new providers. Most users access SDT only indirectly by using other providers.
 -   **[Syscall Provider](../reference/dtrace_providers_syscall.md)**  
 The `syscall` provider makes available a probe at the entry to and return from every system call in the system.
+-   **[TCP Provider](../reference/dtrace_providers_tcp.md)**  
+The `tcp` provider makes available probe at different phases of TCP processing.
 -   **[USDT Provider](../reference/dtrace-ref-StaticallyDefinedTracingofUserApplications.md)**
 Use the USDT provider, for user space statically defined tracing, to instrument user space code with probes that are meaningful for an application.
diff --git a/doc/userguide/reference/dtrace_providers_tcp.md b/doc/userguide/reference/dtrace_providers_tcp.md
new file mode 100644
index 000000000..9f6e4928c
--- /dev/null
+++ b/doc/userguide/reference/dtrace_providers_tcp.md
@@ -0,0 +1,128 @@
+
+# TCP Provider
+
+The `tcp` provider makes available probes that mark different
+phases of tcp processing.
+
+**Parent topic:**[DTrace Provider Reference](../reference/dtrace_providers.md)
+
+## tcp Probes
+
+`tcp` provides a probe for each of TCP accept (established or refused), connect
+(request, established, refused), send, receive, and state-change:
+
+- `accept-established`
+- `accept-refused`
+- `connect-request`
+- `connect-established`
+- `connect-refused`
+- `send`
+- `receive`
+- `state-change`
+
+The module name is always `vmlinux` and the function name is empty.
+
+## tcp Probe Arguments
+
+The following table lists the argument types for `tcp` probes.
+
+| probe                 | `args[0]`     | `args[1]`    | `args[2]`    | `args[3]`      | `args[4]`     | `args[5]`       |
+| :---                  | :---          | :---         | :---         | :---           | :---          | :---            |
+| `accept-established`  | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `accept-refused`      | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `connect-request`     | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `connect-established` | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `connect-refused`     | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `send`                | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `receive`             | `pktinfo_t *` | `csinfo_t *` | `ipinfo_t *` | `tcpsinfo_t *` | `tcpinfo_t *` | `void`          |
+| `state-change`        | `void`        | `csinfo_t *` | `void`       | `tcpsinfo_t *` | `void`        | `tcplsinfo_t *` |
+
+The `pktinfo_t`, `csinfo_t`, and `ipinfo_t` structures are described in [IP Provider](dtrace_providers_ip.md).
+
+### tcpinfo\_t
+
+The `tcpinfo_t` structure contains TCP header fields.
+Detailed information about this data structure can be found in `/usr/lib64/dtrace/*version*/tcp.d`.
+The definition of `tcpinfo_t` is as follows:
+
+```nocopybutton
+typedef struct tcpinfo {
+        uint16_t tcp_sport;      /* source port */
+        uint16_t tcp_dport;      /* destination port */
+        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_window;     /* window size */
+        uint16_t tcp_checksum;   /* checksum */
+        uint16_t tcp_urgent;     /* urgent data pointer */
+        uintptr_t tcp_hdr;       /* raw TCP header */
+} tcpinfo_t;
+```
+
+**Note:**
+
+DTrace translates the members of `tcpinfo_t` from a `struct tcphdr *`.
+
+### tcpsinfo\_t
+
+The `tcpsinfo_t` structure contains stable TCP details from tcp_t.
+Detailed information about this data structure can be found in `/usr/lib64/dtrace/*version*/tcp.d`.
+The definition of `tcpsinfo_t` is as follows:
+
+```nocopybutton
+typedef struct tcpsinfo {
+        uintptr_t tcps_addr;
+        int tcps_local;              /* is delivered locally, boolean */
+        uint16_t tcps_lport;         /* local port */
+        uint16_t tcps_rport;         /* remote port */
+        string tcps_laddr;           /* local address, as a string */
+        string tcps_raddr;           /* remote address, as a string */
+        int tcps_state;              /* TCP state */
+        uint32_t tcps_iss;           /* Initial sequence # sent */
+        uint32_t tcps_suna;          /* sequence # sent but unacked */
+        uint32_t tcps_snxt;          /* next sequence # to send */
+        uint32_t tcps_rnxt;          /* next sequence # expected */
+        uint32_t tcps_swnd;          /* send window size */
+        int32_t tcps_snd_ws;         /* send window scaling */
+        uint32_t tcps_rwnd;          /* receive window size */
+        int32_t tcps_rcv_ws;         /* receive window scaling */
+        uint32_t tcps_cwnd;          /* congestion window */
+        uint32_t tcps_cwnd_ssthresh; /* threshold for congestion avoidance */
+        uint32_t tcps_sack_snxt;     /* next SACK seq # for retransmission */
+        uint32_t tcps_rto;           /* round-trip timeout, msec */
+        uint32_t tcps_mss;           /* max segment size */
+        int tcps_retransmit;         /* retransmit send event, boolean */
+        uint32_t tcps_rtt;           /* smoothed avg round-trip time, msec */
+        uint32_t tcps_rtt_sd;        /* standard deviation of RTT */
+        uint32_t tcps_irs;           /* Initial recv sequence # */
+} tcpsinfo_t;
+```
+
+**Note:**
+
+DTrace translates the members of `tcpsinfo_t` from a `struct tcp_sock *`.
+
+### tcplsinfo\_t
+
+The `tcplsinfo_t` structure has the old tcp state for state changes.
+Detailed information about this data structure can be found in `/usr/lib64/dtrace/*version*/tcp.d`.
+The definition of `tcplsinfo_t` is as follows:
+
+```nocopybutton
+typedef struct tcplsinfo {
+        int tcps_state;        /* previous TCP state */
+} tcplsinfo_t;
+```
+
+## tcp Stability
+
+The `tcp` provider uses DTrace's stability mechanism to describe its stabilities. These stability values are listed in the following table.
+
+| Element   | Name Stability | Data Stability | Dependency Class |
+| :---      | :---           | :---           | :---             |
+| Provider  | Evolving       | Evolving       | ISA              |
+| Module    | Private        | Private        | Unknown          |
+| Function  | Private        | Private        | Unknown          |
+| Name      | Evolving       | Evolving       | ISA              |
+| Arguments | Evolving       | Evolving       | ISA              |
-- 
2.47.3


  parent reply	other threads:[~2025-09-26 19:06 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-26 19:05 [PATCH 01/20] Fix comment since pkt_addr is not NULL eugene.loh
2025-09-26 19:05 ` [PATCH 02/20] doc: Add a space eugene.loh
2025-10-23 19:50   ` [DTrace-devel] " Elena Zannoni
2025-09-26 19:05 ` [PATCH 03/20] doc: Add separator lines to cpc Markdown tables eugene.loh
2025-10-23 19:51   ` [DTrace-devel] " Elena Zannoni
2025-09-26 19:05 ` [PATCH 04/20] doc: Convert stability attribute tables to Markdown for readability eugene.loh
2025-10-23 19:52   ` [DTrace-devel] " Elena Zannoni
2025-09-26 19:05 ` [PATCH 05/20] doc: Remove duplicate id eugene.loh
2025-09-26 19:05 ` [PATCH 06/20] doc: Clean up dangling anchor links eugene.loh
2025-09-26 19:05 ` [PATCH 07/20] doc: Remove internal ID definition at top of file eugene.loh
2025-10-22  3:03   ` Eugene Loh
2025-09-26 19:05 ` [PATCH 08/20] doc: Fix anchor links for built-in variables eugene.loh
2025-09-26 19:05 ` [PATCH 09/20] doc: Fix anchor links for providers eugene.loh
2025-09-26 19:05 ` [PATCH 10/20] doc: Fix anchor links for explanation/ eugene.loh
2025-09-26 19:05 ` [PATCH 11/20] doc: Fix anchor links for how-to/ eugene.loh
2025-09-26 19:05 ` [PATCH 12/20] doc: Fix anchor links for reference/ eugene.loh
2025-09-26 19:05 ` [PATCH 13/20] doc: Clean up the table for string relational operators eugene.loh
2025-09-26 19:05 ` [PATCH 14/20] doc: Link to "Character Escape Sequences" table eugene.loh
2025-09-26 19:05 ` [PATCH 15/20] doc: Clean up profile unit table eugene.loh
2025-09-26 19:05 ` [PATCH 16/20] doc: Clean up undefined anchor links eugene.loh
2025-09-26 19:05 ` [PATCH v2 17/20] doc: Add IP provider documentation eugene.loh
2025-10-09 17:03   ` Kris Van Hees
2025-10-09 21:00     ` Eugene Loh
2025-10-09 21:45       ` Kris Van Hees
2025-10-09 22:28         ` Eugene Loh
2025-09-26 19:05 ` eugene.loh [this message]
2025-10-24  8:24   ` [PATCH 18/20] doc: Add TCP " Alan Maguire
2025-09-26 19:05 ` [PATCH 19/20] doc: Add UDP " eugene.loh
2025-10-24  8:18   ` Alan Maguire
2025-09-26 19:05 ` [PATCH 20/20] doc: Add rawfbt " eugene.loh
2025-10-07 15:23 ` [PATCH 01/20] Fix comment since pkt_addr is not NULL Kris Van Hees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250926190557.8485-18-eugene.loh@oracle.com \
    --to=eugene.loh@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox