Re: [PATCH bpf-next] bpftool: Print map_extra in map show
From: Quentin Monnet
Date: Fri Oct 16 2026 - 10:26:33 EST
2026-10-16 15:16 UTC+0800 ~ chenyuan_fl@xxxxxxx
> From: Yuan Chen <chenyuan@xxxxxxxxxx>
>
> bpf_map_info::map_extra carries per-map-type creation attributes
> (hash function count for bloom filter, VMA start for arena). The
> kernel prints it in fdinfo, but bpftool does not. Print the raw
> value in plain and JSON output when non-zero, without interpreting
> it per map type, like map_flags. The attribute is already overloaded
> per map type, and bpftool must not grow per-type knowledge of it.
Why not? Do we expect the semantic of map_extra to change? Having
something like "nr_hash_funcs 7" in plain output in the case of a Bloom
filter would be easier to interpret?
>
> Example (bloom filter with 7 hash functions):
>
> 117665: bloom_filter name featu_bloom flags 0x0
> key 0B value 8B max_entries 128 map_extra 0x7 memlock 520B
> pids fixture(3543054)
>
> Signed-off-by: Yuan Chen <chenyuan@xxxxxxxxxx>