> selftests/bpf: Use %p for pointer formatting
>
> Networking used to print the socket pointer with %p as output in the
> /proc interface. This was later changed to %pK in order not to reveal
> the actual pointer value. The output format has then been copied to bpf
> tests which produce the same format including the %pK format modifier.
>
> Networking recently replaced the socket output with a plain 0 because
> the socket pointer added no value to the output and the %pK should be
> removed from library handling. The format remained otherwise unchanged in
> order not to break any tools which parsing this information.
>
> This change removes the %pK modifier from bpf, following the change in
> networking.
Does this subject line accurately describe what the patch does?
Looking at the actual changes, no %p format specifier is introduced
anywhere in the test code:
- bpf_iter_netlink.c gets a literal "0 " string
- bpf_iter_tcp4.c / bpf_iter_tcp6.c / bpf_iter_udp4.c / bpf_iter_udp6.c
get a literal "0" string
- bpf_iter_unix.c gets "%08u" with a constant 0 argument
- test_snprintf.c simply drops the %pK specifier (its remaining %p was
already present before this patch)
The only place where %p appears in the patch is in README.rst, in a
historical verifier log excerpt.
The body text says "This change removes the %pK modifier from bpf",
which matches the v1 subject "selftests/bpf: Replace %pK output with 0"
rather than this v2 subject.
A few additional points:
The changelog is unchanged from v1 and doesn't mention the
header/column-width edits this version adds:
- bpf_iter_netlink.c "sk" column changed from 17 to 3 chars
- bpf_iter_unix.c "Num" column changed from 18 to 10 chars
This seems relevant since the body asserts "The format remained
otherwise unchanged in order not to break any tools".
The referenced networking commit isn't named in the message. Looking at
the v1 discussion, commit 7c0ec6288b497 ("net: Replace %pK output with
0") was cited below the --- separator, so it's absent from the committed
message. That commit doesn't appear to be in this tree yet (checking
net/netlink/af_netlink.c, net/unix/af_unix.c, net/ipv4/udp.c and the
tcp_ipv[46].c files still use %pK), which would make a Link: or commit
reference useful for readers.
> order not to break any tools which parsing this information.
This isn't a bug, but there's a grammar error here ("which parsing"
should be "which are parsing").
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/35336391118