Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently these tools just grab the last 2 or 4 bytes of IPv6 addresses. This diff changes them to grab the whole address, as well as fixing a few other things here and there (timestamps were off by 10 and not floats, --lossprobe wasn't used).
I had to move things about in the v6 struct to make
bpf_probe_read(&data.6.daddr, sizeof(data6.daddr), &sk->...)
work correctly. Without this many of the fields were garbage so I assume this is an alignment issue (@4ast can this be caught?)@brendangregg, in #503 you mentioned moving
inet_ntoa()
into the library. Was that because you couldn't get the versions insocket
working, or was it so we could reuse the same code outside of Python? Thesocket
versions here seem to work so shout out if I missed something.Lastly, the output with IPv6 addresses is kinda grim as they overflow the v4 columns (e.g. see tools/tcpconnlat_example.txt). I'm not sure what to do about this. Making all the columns wide enough for the widest possible v6 addresses is going to make the output much wider than 80 chars. I considered changing the format based on whether the host even had a v6 address but that's quite a lot more complexity and IPv6 is rapidly becoming the norm.