net: add location to trace_consume_skb()
Subsystems (3)
PATCH 1/1 net: add location to trace_consume_skb()
kfree_skb() includes the location, it makes sense
to add it to consume_skb() as well.
After patch:
taskd_EventMana 8602 [004] 420.406239: skb:consume_skb: skbaddr=0xffff893a4a6d0500 location=unix_stream_read_generic
swapper 0 [011] 422.732607: skb:consume_skb: skbaddr=0xffff89597f68cee0 location=mlx4_en_free_tx_desc
discipline 9141 [043] 423.065653: skb:consume_skb: skbaddr=0xffff893a487e9c00 location=skb_consume_udp
swapper 0 [010] 423.073166: skb:consume_skb: skbaddr=0xffff8949ce9cdb00 location=icmpv6_rcv
borglet 8672 [014] 425.628256: skb:consume_skb: skbaddr=0xffff8949c42e9400 location=netlink_dump
swapper 0 [028] 426.263317: skb:consume_skb: skbaddr=0xffff893b1589dce0 location=net_rx_action
wget 14339 [009] 426.686380: skb:consume_skb: skbaddr=0xffff893a51b552e0 location=tcp_rcv_state_processSigned-off-by Eric Dumazet <[email protected]>
--- include/trace/events/skb.h | 10 ++++++---- net/core/dev.c | 2 +- net/core/skbuff.c | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-)
include/trace/events/skb.h +6 -4
@@ -53,19 +53,21 @@ TRACE_EVENT(kfree_skb,TRACE_EVENT (consume_skb, - TP_PROTO(struct sk_buff *skb), + TP_PROTO(struct sk_buff *skb, void *location), -TP_ARGS (skb), +TP_ARGS (skb, location),TP_STRUCT__entry ( - __field( void *, skbaddr ) + __field( void *, skbaddr) + __field( void *, location) ),TP_fast_assign ( __entry->skbaddr = skb; + __entry->location = location; ), -TP_printk ("skbaddr=%p" , __entry->skbaddr) +TP_printk ("skbaddr=%p location=%pS" , __entry->skbaddr, __entry->location) ); TRACE_EVENT(skb_copy_datagram_iovec,
net/core/dev.c +1 -1
@@ -5027,7 +5027,7 @@ static __latent_entropy void net_tx_action(struct softirq_action *h)WARN_ON (refcount_read (&skb->users));if (likely (get_kfree_skb_cb (skb)->reason ==SKB_REASON_CONSUMED )) -trace_consume_skb (skb); +trace_consume_skb (skb, net_tx_action);else trace_kfree_skb (skb, net_tx_action,SKB_DROP_REASON_NOT_SPECIFIED );
net/core/skbuff.c +4 -4
@@ -991,7 +991,7 @@ bool __kfree_skb_reason(struct sk_buff *skb, enum skb_drop_reason reason)DEBUG_NET_WARN_ON_ONCE (reason <=0 || reason >=SKB_DROP_REASON_MAX );if (reason ==SKB_CONSUMED ) -trace_consume_skb (skb); +trace_consume_skb (skb,__builtin_return_address (0 ));else trace_kfree_skb (skb,__builtin_return_address (0 ), reason);return true;
@@ -1189,7 +1189,7 @@ void consume_skb(struct sk_buff *skb)if (!skb_unref (skb))return ; -trace_consume_skb (skb); +trace_consume_skb (skb,__builtin_return_address (0 ));__kfree_skb (skb); }EXPORT_SYMBOL (consume_skb);
@@ -1204,7 +1204,7 @@ EXPORT_SYMBOL(consume_skb);*/ void __consume_stateless_skb (struct sk_buff *skb) { -trace_consume_skb (skb); +trace_consume_skb (skb,__builtin_return_address (0 ));skb_release_data (skb,SKB_CONSUMED );kfree_skbmem (skb); }
@@ -1260,7 +1260,7 @@ void napi_consume_skb(struct sk_buff *skb, int budget)return ;/* if reaching here SKB is ready to free */ -trace_consume_skb (skb); +trace_consume_skb (skb,__builtin_return_address (0 ));/* if SKB is a clone, don't handle this case */ if (skb->fclone !=SKB_FCLONE_UNAVAILABLE ) {
Signature · 1 line
2.39.1.581.gbfd45094c4-goog
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 13 lines · On Thu, 16 Feb 2023 15:47:18 +0000 you wrote:
kfree_skb()includes the location, it makes sense
to add it toconsume_skb()as well.After patch:
taskd_EventMana 8602 [004] 420.406239: skb:consume_skb: skbaddr=0xffff893a4a6d0500 location=unix_stream_read_generic swapper 0 [011] 422.732607: skb:consume_skb: skbaddr=0xffff89597f68cee0 location=mlx4_en_free_tx_desc discipline 9141 [043] 423.065653: skb:consume_skb: skbaddr=0xffff893a487e9c00 location=skb_consume_udp swapper 0 [010] 423.073166: skb:consume_skb: skbaddr=0xffff8949ce9cdb00 location=icmpv6_rcv borglet 8672 [014] 425.628256: skb:consume_skb: skbaddr=0xffff8949c42e9400 location=netlink_dump swapper 0 [028] 426.263317: skb:consume_skb: skbaddr=0xffff893b1589dce0 location=net_rx_action wget 14339 [009] 426.686380: skb:consume_skb: skbaddr=0xffff893a51b552e0 location=tcp_rcv_state_process
Quoted 1 line
[...]
Here is the summary with links:
- [net-next] net: add location to trace_consume_skb()
https://git.kernel.org/netdev/net-next/c/dd1b527831a3
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html