diff options
| author | Breno Leitao <[email protected]> | 2025-04-08 18:32:02 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-04-11 01:34:05 +0000 |
| commit | 0f08335ade71273f89d19412268b48b55f3e3726 (patch) | |
| tree | 5cd2ae7708d894c5823c0482c67db0be54ea697c /net/ipv4/tcp.c | |
| parent | net: pass const to msg_data_left() (diff) | |
| download | kernel-0f08335ade71273f89d19412268b48b55f3e3726.tar.gz kernel-0f08335ade71273f89d19412268b48b55f3e3726.zip | |
trace: tcp: Add tracepoint for tcp_sendmsg_locked()
Add a tracepoint to monitor TCP send operations, enabling detailed
visibility into TCP message transmission.
Create a new tracepoint within the tcp_sendmsg_locked function,
capturing traditional fields along with size_goal, which indicates the
optimal data size for a single TCP segment. Additionally, a reference to
the struct sock sk is passed, allowing direct access for BPF programs.
The implementation is largely based on David's patch[1] and suggestions.
Link: https://lore.kernel.org/all/[email protected]/ [1]
Signed-off-by: Breno Leitao <[email protected]>
Reviewed-by: David Ahern <[email protected]>
Reviewed-by: Kuniyuki Iwashima <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv4/tcp.c')
| -rw-r--r-- | net/ipv4/tcp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 6edc441b3702..e0e96f8fd47c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -1160,6 +1160,8 @@ restart: if (skb) copy = size_goal - skb->len; + trace_tcp_sendmsg_locked(sk, msg, skb, size_goal); + if (copy <= 0 || !tcp_skb_can_collapse_to(skb)) { bool first_skb; |
