Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align output columns #374

Closed
wants to merge 12 commits into from

Conversation

jschwinger233
Copy link
Member

@jschwinger233 jschwinger233 commented May 17, 2024

The output of pwru --output-meta --output-tuple now is like:

SKB                CPU PROCESS          NETNS      MARK          IFACE       PROTO  MTU   LEN   TUPLE FUNC
0xffff9fc1014a8700 0   ~/ampdaemon:4417          0 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        netlink_broadcast
0xffff9fc1014a8700 0   ~/ampdaemon:4417          0 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        netlink_trim
0xffff9fc1014a8700 0   ~/ampdaemon:4417          0 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        sk_filter_trim_cap
0xffff9fc1014a8700 0   ~/ampdaemon:4417          0 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        security_sock_rcv_skb
0xffff9fc1014a8700 0   ~/ampdaemon:4417          0 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        apparmor_socket_sock_rcv_skb
0xffff9fc1014a8700 0   ~/ampdaemon:4417          0 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        netlink_skb_set_owner_r
0xffff9fc1014a8700 0   ~/ampdaemon:4417 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        __netlink_sendskb
0xffff9fc1014a8700 0   ~/ampdaemon:4417 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        skb_queue_tail
0xffff9fc1014a8700 0   ~/ampdaemon:4417 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        consume_skb
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        skb_free_datagram
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        consume_skb
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        skb_release_head_state
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        netlink_skb_destructor
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        sock_rfree
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        skb_release_data
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        skb_free_head
0xffff9fc1014a8700 11  ~code42-aat:1053 4026531840 00000000        0         0x0000 0     76    0.0.0.0:0->1.0.0.0:0()                        kfree_skbmem
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000        0         0x0000 0     150   172.19.0.6:6443->172.19.0.4:55646(tcp)        ip_local_out
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000        0         0x0000 0     150   172.19.0.6:6443->172.19.0.4:55646(tcp)        __ip_local_out
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000        0         0x0800 0     150   172.19.0.6:6443->172.19.0.4:55646(tcp)        nf_hook_slow
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000        0         0x0800 0     150   172.19.0.6:6443->172.19.0.4:55646(tcp)        ip_output
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000     eth0:22      0x0800 1500  150   172.19.0.6:6443->172.19.0.4:55646(tcp)        nf_hook_slow
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000     eth0:22      0x0800 1500  150   172.19.0.6:6443->172.19.0.4:55646(tcp)        apparmor_ip_postroute
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000     eth0:22      0x0800 1500  150   172.19.0.6:6443->172.19.0.4:55646(tcp)        ip_finish_output
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000     eth0:22      0x0800 1500  150   172.19.0.6:6443->172.19.0.4:55646(tcp)        __ip_finish_output
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000     eth0:22      0x0800 1500  150   172.19.0.6:6443->172.19.0.4:55646(tcp)        ip_finish_output2
0xffff9fc1ad4c84e8 2   ~-apiserver:5328 4026533261 00000000     eth0:22      0x0800 1500  164   172.19.0.6:6443->172.19.0.4:55646(tcp)        __dev_queue_xmit

Signed-off-by: gray <gray.liang@isovalent.com>
Because it has variant length.

Signed-off-by: gray <gray.liang@isovalent.com>
Signed-off-by: gray <gray.liang@isovalent.com>
Signed-off-by: gray <gray.liang@isovalent.com>
Signed-off-by: gray <gray.liang@isovalent.com>
Signed-off-by: gray <gray.liang@isovalent.com>
Also strip 0x prefix.

Signed-off-by: gray <gray.liang@isovalent.com>
ifname can be as long as 16 bytes, plust len of ifindex
len(str(1<<32))=10, it should be at least 26.

However, 16 is enough for most of situations, so let's make it 16.

Also center align this column out of aesthetics.

Signed-off-by: gray <gray.liang@isovalent.com>
Signed-off-by: gray <gray.liang@isovalent.com>
Actually it's a uint32, but let's make it 5 that fits most scenarios.

Signed-off-by: gray <gray.liang@isovalent.com>
Still, it's a u32, but let's treat it as u16 for most cases.

Signed-off-by: gray <gray.liang@isovalent.com>
So that the following FUNC can be aligned

Signed-off-by: gray <gray.liang@isovalent.com>
@jschwinger233
Copy link
Member Author

Closed in favor of #376

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant