Thread (9 messages) 9 messages, 4 authors, 2023-01-10

Re: [External] Re: [PATCH v4] sock: add tracepoint for send recv length

From: 运辉崔 <hidden>
Date: 2023-01-10 09:01:41
Also in: lkml, netdev

On Mon, Jan 9, 2023 at 11:39 PM Steven Rostedt [off-list ref] wrote:
But looking at this tracepoint again, I see a issue that can help with the
dereferencing.

Why is family and protocol passed in?

+       trace_sock_send_length(sock->sk, sock->sk->sk_family,
+                              sock->sk->sk_protocol, ret, 0);


Where the TP_fast_assign() is:

+       TP_fast_assign(
+               __entry->sk = sk;
+               __entry->family = sk->sk_family;
+               __entry->protocol = sk->sk_protocol;
+               __entry->length = ret > 0 ? ret : 0;
+               __entry->error = ret < 0 ? ret : 0;
+               __entry->flags = flags;
+       ),

The family and protocol is taken from the sk, and not the parameters. I bet
dropping those would help.

-- Steve
Many thanks to Eric and Steven for your discussions and suggestions, I
will update on v5.


Thanks,
Yunhui
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help