linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace
@ 2024-03-04  9:29 Jason Xing
  2024-03-04  9:29 ` [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class Jason Xing
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jason Xing @ 2024-03-04  9:29 UTC (permalink / raw)
  To: edumazet, mhiramat, mathieu.desnoyers, rostedt, kuba, pabeni
  Cc: netdev, linux-trace-kernel, kerneljasonxing, Jason Xing

From: Jason Xing <kernelxing@tencent.com>

When I reviewed other people's patch [1], I noticed that similar things
also happen in tcp_event_skb class and tcp_event_sk_skb class. They
don't print those two addrs of skb/sk which already exist.

In this patch, I just do as other trace functions do, like
trace_net_dev_start_xmit(), to know the exact flow or skb we would like
to know in case some systems doesn't support BPF programs well or we
have to use /sys/kernel/debug/tracing only for some reasons.

[1]
Link: https://lore.kernel.org/netdev/CAL+tcoAhvFhXdr1WQU8mv_6ZX5nOoNpbOLAB6=C+DB-qXQ11Ew@mail.gmail.com/

v2
Link: https://lore.kernel.org/netdev/CANn89iJcScraKAUk1GzZFoOO20RtC9iXpiJ4LSOWT5RUAC_QQA@mail.gmail.com/
1. change the description.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
  2024-03-04  9:29 [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace Jason Xing
@ 2024-03-04  9:29 ` Jason Xing
  2024-03-07 11:36   ` Eric Dumazet
  2024-03-04  9:29 ` [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class Jason Xing
  2024-03-07 14:40 ` [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Jason Xing @ 2024-03-04  9:29 UTC (permalink / raw)
  To: edumazet, mhiramat, mathieu.desnoyers, rostedt, kuba, pabeni
  Cc: netdev, linux-trace-kernel, kerneljasonxing, Jason Xing

From: Jason Xing <kernelxing@tencent.com>

Printing the addresses can help us identify the exact skb/sk
for those system in which it's not that easy to run BPF program.
As we can see, it already fetches those, then use it directly
and it will print like below:

...tcp_retransmit_skb: skbaddr=XXX skaddr=XXX family=AF_INET...

Signed-off-by: Jason Xing <kernelxing@tencent.com>
--
v2
Link: https://lore.kernel.org/netdev/CANn89iJcScraKAUk1GzZFoOO20RtC9iXpiJ4LSOWT5RUAC_QQA@mail.gmail.com/
1. correct the previous description
---
 include/trace/events/tcp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index 7b1ddffa3dfc..ac36067ae066 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -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,
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class
  2024-03-04  9:29 [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace Jason Xing
  2024-03-04  9:29 ` [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class Jason Xing
@ 2024-03-04  9:29 ` Jason Xing
  2024-03-07 11:36   ` Eric Dumazet
  2024-03-07 14:40 ` [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace patchwork-bot+netdevbpf
  2 siblings, 1 reply; 6+ messages in thread
From: Jason Xing @ 2024-03-04  9:29 UTC (permalink / raw)
  To: edumazet, mhiramat, mathieu.desnoyers, rostedt, kuba, pabeni
  Cc: netdev, linux-trace-kernel, kerneljasonxing, Jason Xing

From: Jason Xing <kernelxing@tencent.com>

Use the existing parameter and print the address of skbaddr
as other trace functions do.

Signed-off-by: Jason Xing <kernelxing@tencent.com>
---
 include/trace/events/tcp.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/tcp.h b/include/trace/events/tcp.h
index ac36067ae066..6ca3e0343666 100644
--- a/include/trace/events/tcp.h
+++ b/include/trace/events/tcp.h
@@ -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,
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
  2024-03-04  9:29 ` [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class Jason Xing
@ 2024-03-07 11:36   ` Eric Dumazet
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2024-03-07 11:36 UTC (permalink / raw)
  To: Jason Xing
  Cc: mhiramat, mathieu.desnoyers, rostedt, kuba, pabeni, netdev,
	linux-trace-kernel, Jason Xing

On Mon, Mar 4, 2024 at 10:29 AM Jason Xing <kerneljasonxing@gmail.com> wrote:
>
> From: Jason Xing <kernelxing@tencent.com>
>
> Printing the addresses can help us identify the exact skb/sk
> for those system in which it's not that easy to run BPF program.
> As we can see, it already fetches those, then use it directly
> and it will print like below:
>
> ...tcp_retransmit_skb: skbaddr=XXX skaddr=XXX family=AF_INET...
>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>

Reviewed-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class
  2024-03-04  9:29 ` [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class Jason Xing
@ 2024-03-07 11:36   ` Eric Dumazet
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2024-03-07 11:36 UTC (permalink / raw)
  To: Jason Xing
  Cc: mhiramat, mathieu.desnoyers, rostedt, kuba, pabeni, netdev,
	linux-trace-kernel, Jason Xing

On Mon, Mar 4, 2024 at 10:29 AM Jason Xing <kerneljasonxing@gmail.com> wrote:
>
> From: Jason Xing <kernelxing@tencent.com>
>
> Use the existing parameter and print the address of skbaddr
> as other trace functions do.
>
> Signed-off-by: Jason Xing <kernelxing@tencent.com>

Reviewed-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace
  2024-03-04  9:29 [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace Jason Xing
  2024-03-04  9:29 ` [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class Jason Xing
  2024-03-04  9:29 ` [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class Jason Xing
@ 2024-03-07 14:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-03-07 14:40 UTC (permalink / raw)
  To: Jason Xing
  Cc: edumazet, mhiramat, mathieu.desnoyers, rostedt, kuba, pabeni,
	netdev, linux-trace-kernel, kernelxing

Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon,  4 Mar 2024 17:29:32 +0800 you wrote:
> From: Jason Xing <kernelxing@tencent.com>
> 
> When I reviewed other people's patch [1], I noticed that similar things
> also happen in tcp_event_skb class and tcp_event_sk_skb class. They
> don't print those two addrs of skb/sk which already exist.
> 
> In this patch, I just do as other trace functions do, like
> trace_net_dev_start_xmit(), to know the exact flow or skb we would like
> to know in case some systems doesn't support BPF programs well or we
> have to use /sys/kernel/debug/tracing only for some reasons.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class
    https://git.kernel.org/netdev/net-next/c/4e441bb8aca1
  - [net-next,v2,2/2] tcp: add tracing of skbaddr in tcp_event_skb class
    https://git.kernel.org/netdev/net-next/c/0ab544b6f055

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-03-07 14:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04  9:29 [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace Jason Xing
2024-03-04  9:29 ` [PATCH net-next v2 1/2] tcp: add tracing of skb/skaddr in tcp_event_sk_skb class Jason Xing
2024-03-07 11:36   ` Eric Dumazet
2024-03-04  9:29 ` [PATCH net-next v2 2/2] tcp: add tracing of skbaddr in tcp_event_skb class Jason Xing
2024-03-07 11:36   ` Eric Dumazet
2024-03-07 14:40 ` [PATCH net-next v2 0/2] tcp: add two missing addresses when using trace patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).