]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: Print hashed skb addresses for all net and qdisc events
authorSubash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Fri, 24 Jun 2022 21:34:25 +0000 (15:34 -0600)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jun 2022 10:57:06 +0000 (11:57 +0100)
The following commits added support for printing the real address-
ee739691dc53 ("net: use %px to print skb address in trace_netif_receive_skb")
f1952530daae ("net_sched: introduce tracepoint trace_qdisc_enqueue()")
45bbcd62f4b4 ("net_sched: use %px to print skb address in trace_qdisc_dequeue()")

However, tracing the packet traversal shows a mix of hashes and real
addresses. Pasting a sample trace for reference-

ping-14249   [002] .....  3424.046612: netif_rx_entry: dev=lo napi_id=0x3 queue_mapping=0
skbaddr=00000000dcbed83e vlan_tagged=0 vlan_proto=0x0000 vlan_tci=0x0000 protocol=0x0800
ip_summed=0 hash=0x00000000 l4_hash=0 len=84 data_len=0 truesize=768 mac_header_valid=1
mac_header=-14 nr_frags=0 gso_size=0 gso_type=0x0
ping-14249   [002] .....  3424.046615: netif_rx: dev=lo skbaddr=ffffff888e5d1000 len=84

Switch the trace print formats to %p for all the events to have a
consistent format of printing the hashed addresses in all cases.

Signed-off-by: Sean Tranchetti <quic_stranche@quicinc.com>
Signed-off-by: Subash Abhinov Kasiviswanathan <quic_subashab@quicinc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/trace/events/net.h
include/trace/events/qdisc.h

index 032b431b987b63b5fab1d3c763643d6192f2c325..da611a7aaf970f541949cdd87ac9203c4c7e81b1 100644 (file)
@@ -136,7 +136,7 @@ DECLARE_EVENT_CLASS(net_dev_template,
                __assign_str(name, skb->dev->name);
        ),
 
-       TP_printk("dev=%s skbaddr=%px len=%u",
+       TP_printk("dev=%s skbaddr=%p len=%u",
                __get_str(name), __entry->skbaddr, __entry->len)
 )
 
index 59c945b66f9c7469bc071e2a27efb8bfa9eb19f7..a3995925cb057021dc779344d19f7e3724f6df3c 100644 (file)
@@ -41,7 +41,7 @@ TRACE_EVENT(qdisc_dequeue,
                __entry->txq_state      = txq->state;
        ),
 
-       TP_printk("dequeue ifindex=%d qdisc handle=0x%X parent=0x%X txq_state=0x%lX packets=%d skbaddr=%px",
+       TP_printk("dequeue ifindex=%d qdisc handle=0x%X parent=0x%X txq_state=0x%lX packets=%d skbaddr=%p",
                  __entry->ifindex, __entry->handle, __entry->parent,
                  __entry->txq_state, __entry->packets, __entry->skbaddr )
 );
@@ -70,7 +70,7 @@ TRACE_EVENT(qdisc_enqueue,
                __entry->parent  = qdisc->parent;
        ),
 
-       TP_printk("enqueue ifindex=%d qdisc handle=0x%X parent=0x%X skbaddr=%px",
+       TP_printk("enqueue ifindex=%d qdisc handle=0x%X parent=0x%X skbaddr=%p",
                  __entry->ifindex, __entry->handle, __entry->parent, __entry->skbaddr)
 );