Skip to contentSkip to conversation

add two missing addresses when using trace

PATCH Superseded Jason Xing 2 participants 7 messages Feb 29, 2024 – Mar 4, 2024

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jason Xing

author
#0 lore raw

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
author
#1 lore raw

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
index 7b1ddffa3dfc..ac36067ae066 100644
@@ -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
#2 lore raw

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

https://yhbt.net/lore/all/[email protected]/

author
#3 lore raw

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

https://yhbt.net/lore/all/[email protected]/

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

author
#4 lore raw

PATCH 2/2 tcp: add tracing of skbaddr in tcp_event_skb class

In reply to Jason Xing

From: 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
index ac36067ae066..6ca3e0343666 100644
@@ -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
author
#5 lore raw
In reply to 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_skb class and tcp_event_sk_skb class. 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

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(-)

--
2.37.3

#6 lore raw
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_skb class and tcp_event_sk_skb class. 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.

https://yhbt.net/lore/all/[email protected]/