Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libbpf tcptop: Fix PID column alignment when pids are large (iovisor#…
…5004) Fix PID column alignment when PIDs are large in libbpf-tools/tcptop: Check the maximum width of the PIDs on the system and adjust the format to avoid column misalignment: PID COMM LADDR RADDR RX_KB TX_KB 1987802 wget 127.0.0.1:44960 127.0.0.1:443 6 0 1987815 wget 127.0.0.1:44968 127.0.0.1:443 6 0 2770 stunnel 127.0.0.1:51460 127.0.0.1:80 4 0 2770 stunnel 127.0.0.1:51452 127.0.0.1:80 4 0 1936412 sshd 10.71.56.137:22 10.71.8.14:45682 0 2 1987805 curl 127.0.0.1:44964 127.0.0.1:443 1 0 1987818 curl 127.0.0.1:44972 127.0.0.1:443 1 0 2770 stunnel 127.0.0.1:51456 127.0.0.1:80 0 0 2770 stunnel 127.0.0.1:51464 127.0.0.1:80 0 0 1918977 sshd 10.71.56.137:22 10.71.8.14:51046 0 0 Also fix the alignment of the "TX_KB" label by moving the trailing "\n" character from it to the format string Also add libbpf-tools/tcptop_example.txt documenting the example. Signed-off-by: Bernhard Kaindl <[email protected]>
- Loading branch information