summaryrefslogtreecommitdiff
path: root/include/linux/btf.h
diff options
context:
space:
mode:
authorManu Bretelle <chantr4@gmail.com>2023-10-19 02:01:32 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2023-10-19 17:29:36 +0300
commit90704b4be0b0d6d0a7a9369d4b9aae6a579602c7 (patch)
treeb7a572801da28d3dc213446b5e72b63c76986f67 /include/linux/btf.h
parent0e133a13370389d3894891eafe54fec2c44ad735 (diff)
downloadlinux-90704b4be0b0d6d0a7a9369d4b9aae6a579602c7.tar.xz
bpftool: Fix printing of pointer value
When printing a pointer value, "%p" will either print the hexadecimal value of the pointer (e.g `0x1234`), or `(nil)` when NULL. Both of those are invalid json "integer" values and need to be wrapped in quotes. Before: ``` $ sudo bpftool struct_ops dump name ned_dummy_cca | grep next "next": (nil), $ sudo bpftool struct_ops dump name ned_dummy_cca | \ jq '.[1].bpf_struct_ops_tcp_congestion_ops.data.list.next' parse error: Invalid numeric literal at line 29, column 34 ``` After: ``` $ sudo ./bpftool struct_ops dump name ned_dummy_cca | grep next "next": "(nil)", $ sudo ./bpftool struct_ops dump name ned_dummy_cca | \ jq '.[1].bpf_struct_ops_tcp_congestion_ops.data.list.next' "(nil)" ``` Signed-off-by: Manu Bretelle <chantr4@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Tested-by: Eduard Zingerman <eddyz87@gmail.com> Acked-by: Eduard Zingerman <eddyz87@gmail.com> Acked-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20231018230133.1593152-2-chantr4@gmail.com
Diffstat (limited to 'include/linux/btf.h')
0 files changed, 0 insertions, 0 deletions