Re: [PATCH bpf v2 0/2] bpftool: Fix sparse CPU IDs
From: Quentin Monnet
Date: Fri Sep 18 2026 - 07:33:58 EST
2026-09-18 19:20 UTC+0900 ~ Hui Su <sh_def@xxxxxxx>
> bpftool currently assumes that possible CPU IDs are dense. This is not true
> when the possible CPU mask itself is sparse, such as 0,2-3. In that case,
> per-CPU map output labels and prog profile event-array keys can refer to the
> wrong logical CPUs.
>
> The first patch keeps dense per-CPU buffer slots separate from logical CPU
> IDs when printing map values, and propagates errors from the shared output
> path to its callers.
>
> The second patch applies the same distinction to prog profile: userspace
> keeps a compact CPU count for result buffers, while BPF event-array keys use
> the logical CPU ID and the logical ID span.
Looks good to me, thank you!
Acked-by: Quentin Monnet <qmo@xxxxxxxxxx>