diff options
author | Peilin Ye <peilin.ye@bytedance.com> | 2023-01-20 03:45:16 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-01-23 14:26:50 +0300 |
commit | 40e0b09081420853542571c38875b48b60404ebb (patch) | |
tree | a0b4e5c2a78286d733182822265380551e5df51d /include/trace | |
parent | a7b87d2a31dcff04ed81ef63355080bdaffa93c3 (diff) | |
download | linux-40e0b09081420853542571c38875b48b60404ebb.tar.xz |
net/sock: Introduce trace_sk_data_ready()
As suggested by Cong, introduce a tracepoint for all ->sk_data_ready()
callback implementations. For example:
<...>
iperf-609 [002] ..... 70.660425: sk_data_ready: family=2 protocol=6 func=sock_def_readable
iperf-609 [002] ..... 70.660436: sk_data_ready: family=2 protocol=6 func=sock_def_readable
<...>
Suggested-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Peilin Ye <peilin.ye@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/sock.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h index 71492e8276da..03d19fc562f8 100644 --- a/include/trace/events/sock.h +++ b/include/trace/events/sock.h @@ -263,6 +263,30 @@ TRACE_EVENT(inet_sk_error_report, __entry->error) ); +TRACE_EVENT(sk_data_ready, + + TP_PROTO(const struct sock *sk), + + TP_ARGS(sk), + + TP_STRUCT__entry( + __field(const void *, skaddr) + __field(__u16, family) + __field(__u16, protocol) + __field(unsigned long, ip) + ), + + TP_fast_assign( + __entry->skaddr = sk; + __entry->family = sk->sk_family; + __entry->protocol = sk->sk_protocol; + __entry->ip = _RET_IP_; + ), + + TP_printk("family=%u protocol=%u func=%ps", + __entry->family, __entry->protocol, (void *)__entry->ip) +); + /* * sock send/recv msg length */ |