include/trace/events/tcp.h
Source file repositories/reference/linux-study-clean/include/trace/events/tcp.h
File Facts
- System
- Linux kernel
- Corpus path
include/trace/events/tcp.h- Extension
.h- Size
- 22237 bytes
- Lines
- 840
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ipv6.hlinux/tcp.hlinux/tracepoint.hnet/ipv6.hnet/tcp.hlinux/sock_diag.hnet/rstreason.htrace/events/net_probe_common.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
if (sk && sk_fullsock(sk)) {
const struct inet_sock *inet = inet_sk(sk);
TP_STORE_ADDR_PORTS(__entry, inet, sk);
} else if (skb__nullable) {
const struct tcphdr *th = (const struct tcphdr *)skb__nullable->data;
/*
* We should reverse the 4-tuple of skb, so later
* it can print the right flow direction of rst.
*/
TP_STORE_ADDR_PORTS_SKB(skb__nullable, th, entry->daddr, entry->saddr);
}
__entry->reason = reason;
),
TP_printk("skbaddr=%p skaddr=%p src=%pISpc dest=%pISpc state=%s reason=%s",
__entry->skbaddr, __entry->skaddr,
__entry->saddr, __entry->daddr,
__entry->state ? show_tcp_state_name(__entry->state) : "UNKNOWN",
__print_symbolic(__entry->reason, DEFINE_RST_REASON(FN, FNe)))
);
#undef FN
#undef FNe
/*
* tcp event with arguments sk
*
* Note: this class requires a valid sk pointer.
*/
DECLARE_EVENT_CLASS(tcp_event_sk,
TP_PROTO(struct sock *sk),
TP_ARGS(sk),
TP_STRUCT__entry(
__field(const void *, skaddr)
__field(__u16, sport)
__field(__u16, dport)
__field(__u16, family)
__array(__u8, saddr, 4)
__array(__u8, daddr, 4)
__array(__u8, saddr_v6, 16)
__array(__u8, daddr_v6, 16)
__field(__u64, sock_cookie)
),
TP_fast_assign(
struct inet_sock *inet = inet_sk(sk);
__be32 *p32;
__entry->skaddr = sk;
__entry->sport = ntohs(inet->inet_sport);
__entry->dport = ntohs(inet->inet_dport);
__entry->family = sk->sk_family;
p32 = (__be32 *) __entry->saddr;
*p32 = inet->inet_saddr;
p32 = (__be32 *) __entry->daddr;
*p32 = inet->inet_daddr;
TP_STORE_ADDRS(__entry, inet->inet_saddr, inet->inet_daddr,
sk->sk_v6_rcv_saddr, sk->sk_v6_daddr);
__entry->sock_cookie = sock_gen_cookie(sk);
),
TP_printk("family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c sock_cookie=%llx",
show_family_name(__entry->family),
__entry->sport, __entry->dport,
__entry->saddr, __entry->daddr,
__entry->saddr_v6, __entry->daddr_v6,
__entry->sock_cookie)
);
DEFINE_EVENT(tcp_event_sk, tcp_receive_reset,
TP_PROTO(struct sock *sk),
TP_ARGS(sk)
);
DEFINE_EVENT(tcp_event_sk, tcp_destroy_sock,
TP_PROTO(struct sock *sk),
TP_ARGS(sk)
Annotation
- Immediate include surface: `linux/ipv6.h`, `linux/tcp.h`, `linux/tracepoint.h`, `net/ipv6.h`, `net/tcp.h`, `linux/sock_diag.h`, `net/rstreason.h`, `trace/events/net_probe_common.h`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.