Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
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 %px for all the events to have a
consistent format of printing the real addresses in all cases.
Signed-off-by: Sean Tranchetti <redacted>
Signed-off-by: Subash Abhinov Kasiviswanathan <redacted>
---
include/trace/events/net.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
From: Eric Dumazet <edumazet@google.com> Date: 2022-06-24 06:27:53
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
I would rather do the opposite.
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 %px for all the events to have a
consistent format of printing the real addresses in all cases.
Signed-off-by: Sean Tranchetti <redacted>
Signed-off-by: Subash Abhinov Kasiviswanathan <redacted>
---
include/trace/events/net.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
quoted
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
I would rather do the opposite.
We don't need the real address. We just need the events to display in
the same format - hashed address is fine.
From: Cong Wang <hidden> Date: 2022-06-27 19:25:06
On Fri, Jun 24, 2022 at 08:27:34AM +0200, Eric Dumazet wrote:
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
quoted
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
Because hashed address is _further_ from being unique, we could even
observe same hashed addresses with a few manually injected packets.
Real address is much better. Although definitely it can't guarantee
uniqueness, it is already the cheapest way to identify the packets in
tracing. (Surely you can add an ID generator or something similiar, but
nothing is cheaper than just using the real address.)
From: Cong Wang <hidden> Date: 2022-06-27 19:27:43
On Fri, Jun 24, 2022 at 02:48:24AM -0600, Subash Abhinov Kasiviswanathan (KS) wrote:
On 6/24/2022 12:27 AM, Eric Dumazet wrote:
quoted
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
quoted
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
I would rather do the opposite.
We don't need the real address. We just need the events to display in the
same format - hashed address is fine.
From: Eric Dumazet <edumazet@google.com> Date: 2022-06-27 19:33:49
On Mon, Jun 27, 2022 at 9:25 PM Cong Wang [off-list ref] wrote:
On Fri, Jun 24, 2022 at 08:27:34AM +0200, Eric Dumazet wrote:
quoted
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
quoted
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
Because hashed address is _further_ from being unique, we could even
observe same hashed addresses with a few manually injected packets.
Real address is much better. Although definitely it can't guarantee
uniqueness, it is already the cheapest way to identify the packets in
tracing. (Surely you can add an ID generator or something similiar, but
nothing is cheaper than just using the real address.)
quoted
I would rather do the opposite.
Strongly disagree. I will sent a revert.
Make sure to include lkml for this discussion :
Vast majority (100%) of TP_printk() using %p use %p, not %px
$ git grep -n TP_printk|grep %p|wc -l
425
$ git grep -n TP_printk|grep %px|wc -l
0
From: Cong Wang <hidden> Date: 2022-06-27 19:42:08
On Mon, Jun 27, 2022 at 12:33 PM Eric Dumazet [off-list ref] wrote:
On Mon, Jun 27, 2022 at 9:25 PM Cong Wang [off-list ref] wrote:
quoted
On Fri, Jun 24, 2022 at 08:27:34AM +0200, Eric Dumazet wrote:
quoted
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
quoted
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
Because hashed address is _further_ from being unique, we could even
observe same hashed addresses with a few manually injected packets.
Real address is much better. Although definitely it can't guarantee
uniqueness, it is already the cheapest way to identify the packets in
tracing. (Surely you can add an ID generator or something similiar, but
nothing is cheaper than just using the real address.)
From: Eric Dumazet <edumazet@google.com> Date: 2022-06-27 19:47:00
On Mon, Jun 27, 2022 at 9:41 PM Cong Wang [off-list ref] wrote:
On Mon, Jun 27, 2022 at 12:33 PM Eric Dumazet [off-list ref] wrote:
quoted
On Mon, Jun 27, 2022 at 9:25 PM Cong Wang [off-list ref] wrote:
quoted
On Fri, Jun 24, 2022 at 08:27:34AM +0200, Eric Dumazet wrote:
quoted
On Fri, Jun 24, 2022 at 8:09 AM Subash Abhinov Kasiviswanathan
[off-list ref] wrote:
quoted
Commit 65875073eddd ("net: use %px to print skb address in trace_netif_receive_skb")
added support for printing the real addresses for the events using
net_dev_template.
It is not clear why the 'real address' is needed in trace events.
Because hashed address is _further_ from being unique, we could even
observe same hashed addresses with a few manually injected packets.
Real address is much better. Although definitely it can't guarantee
uniqueness, it is already the cheapest way to identify the packets in
tracing. (Surely you can add an ID generator or something similiar, but
nothing is cheaper than just using the real address.)
From: Cong Wang <hidden> Date: 2022-07-03 04:43:36
On Mon, Jun 27, 2022 at 12:46 PM Eric Dumazet [off-list ref] wrote:
We have ways for developers : no_hash_pointers
I have no idea why you keep generalizing this topic to all pointers.
You have to realize no one even argues about any other pointers
than just skb's. You must be kidding when you suggest to disable
all hash pointers when people only want skb.
From: Cong Wang <hidden> Date: 2022-07-03 05:58:35
Hmm, I just noticed there is actually a hash-ptr option for trace ring
buffer:
hash-ptr
When set, "%p" in the event printk format displays the
hashed pointer value instead of real address.
This will be useful if you want to find out which hashed
value is corresponding to the real value in trace log.
I am glad people noticed the usefulness of real addresses in tracepoint
before I did.
I will backport this to our 5.10 kernel.
Thanks.