add two missing addresses when using trace
Subsystems (4)
cover add two missing addresses when using trace
From: Jason Xing <[email protected]>
When I reviewed other people's patch [1], I noticed that similar thing also happens in tcp_event_skb class and tcp_event_sk_skb class. They don't print those two addrs of skb/sk which already exist.
They are probably forgotten by the original authors, so this time I finish the work. Also, adding more trace about the socket/skb addr can help us sometime even though the chance is minor.
I don't consider it is a bug, thus I chose to target net-next tree.
Jason Xing (2):
tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
tcp: add tracing of skbaddr in tcp_event_skb class
include/trace/events/tcp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.37.3
PATCH 1/2 tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
From: Jason Xing <[email protected]>
Prio to this patch, the trace function doesn't print addresses which might be forgotten. As we can see, it already fetches those, use it directly and it will print like below:
...tcp_retransmit_skb: skbaddr=XXX skaddr=XXX family=AF_INET...
--- include/trace/events/tcp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/trace/events/tcp.h +2 -1
@@ -88,7 +88,8 @@ DECLARE_EVENT_CLASS(tcp_event_sk_skb, sk->sk_v6_rcv_saddr, sk->sk_v6_daddr); ), - TP_printk("family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c state=%s", + TP_printk("skbaddr=%p skaddr=%p family=%s sport=%hu dport=%hu saddr=%pI4 daddr=%pI4 saddrv6=%pI6c daddrv6=%pI6c state=%s", + __entry->skbaddr, __entry->skaddr, show_family_name(__entry->family), __entry->sport, __entry->dport, __entry->saddr, __entry->daddr, __entry->saddr_v6, __entry->daddr_v6,
Signature · 1 line
2.37.3
Re: [PATCH net-next 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
Quoted 8 lines · Jason Xing
From: Jason Xing <[email protected]>
Prio to this patch, the trace function doesn't print addresses which might be forgotten. As we can see, it already fetches those, use it directly and it will print like below:
...tcp_retransmit_skb: skbaddr=XXX skaddr=XXX family=AF_INET...
It was not forgotten, but a recommendation from Alexei
Re: [PATCH net-next 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
Quoted 9 lines · Eric Dumazet
Quoted 7 lines · Jason Xing
From: Jason Xing <[email protected]>
Prio to this patch, the trace function doesn't print addresses which might be forgotten. As we can see, it already fetches those, use it directly and it will print like below:
Quoted 5 lines
Quoted 1 line
...tcp_retransmit_skb: skbaddr=XXX skaddr=XXX family=AF_INET...
It was not forgotten, but a recommendation from Alexei
Thanks, Eric.
Oh, good to see the old threads. I have to change the description. The other reason why I chose to add address messages is we do have some useful information when using trace ss another thread[1] does: it also ships the trace with address printing.
[1]: https://lore.kernel.org/netdev/20240304034632.GA21357@didi-ThinkCentre-M920t-N000/
Thanks,
Jason
PATCH 2/2 tcp: add tracing of skbaddr in tcp_event_skb class
In reply to Jason XingFrom: Jason Xing <[email protected]>
Use the existing parameter and print it then. It will display the address of skbaddr.
--- include/trace/events/tcp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/trace/events/tcp.h +2 -1
@@ -362,7 +362,8 @@ DECLARE_EVENT_CLASS(tcp_event_skb,TP_STORE_ADDR_PORTS_SKB (__entry, skb); ), -TP_printk ("src=%pISpc dest=%pISpc" , __entry->saddr, __entry->daddr) +TP_printk ("skbaddr=%p src=%pISpc dest=%pISpc" , + __entry->skbaddr, __entry->saddr, __entry->daddr) ); DEFINE_EVENT(tcp_event_skb, tcp_bad_csum,
Signature · 1 line
2.37.3
Quoted 7 lines · Jason Xing
From: Jason Xing <[email protected]>
When I reviewed other people's patch [1], I noticed that similar thing also happens in
tcp_event_skbclass andtcp_event_sk_skbclass. They don't print those two addrs of skb/sk which already exist.
Quoted 5 lines
They are probably forgotten by the original authors, so this time I finish the work. Also, adding more trace about the socket/skb addr can help us sometime even though the chance is minor.
I don't consider it is a bug, thus I chose to target net-next tree.
Gentle ping...No rush. Just in case this simple patchset was lost for some reason.
Thanks,
Jason
Quoted 14 lines
[1]Jason Xing (2):
tcp: add tracing of skb/skaddr intcp_event_sk_skbclass
tcp: add tracing of skbaddr intcp_event_skbclassinclude/trace/events/tcp.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)--
2.37.3
Quoted 9 lines · Jason Xing
Quoted 7 lines · Jason Xing
From: Jason Xing <[email protected]>
When I reviewed other people's patch [1], I noticed that similar thing also happens in
tcp_event_skbclass andtcp_event_sk_skbclass. They don't print those two addrs of skb/sk which already exist.
Quoted 8 lines
Quoted 5 lines
They are probably forgotten by the original authors, so this time I finish the work. Also, adding more trace about the socket/skb addr can help us sometime even though the chance is minor.
I don't consider it is a bug, thus I chose to target net-next tree.
Gentle ping...No rush. Just in case this simple patchset was lost for some reason.
This was a conscious choice I think.