From: Eduard Zingerman <eddyz87@gmail.com>
To: Ihor Solodrai <ihor.solodrai@linux.dev>,
Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
Quentin Monnet <qmo@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v1 3/4] bpftool: Don't drop a type in the sorted C dump
Date: Thu, 20 Aug 2026 13:47:50 -0700 [thread overview]
Message-ID: <478fbefa108d7da8eb28897998857ab72467b276.camel@gmail.com> (raw)
In-Reply-To: <20260820000627.3826188-4-ihor.solodrai@linux.dev>
On Wed, 2026-08-19 at 17:06 -0700, Ihor Solodrai wrote:
> The C dump sorts types by default, so that generated headers are
> diffable. The sorted dump emits one type fewer than the unsorted dump
> of the same BTF.
>
> dump_btf_c() starts its loop at index 1 to skip the void type at BTF
> type ID 0. That holds for the unsorted dump, where the array index is
> the type ID, but not after qsort(): position 0 is then the lowest ranked
> type, and btf_type_rank() ranks an anonymous enum 0 while void takes the
> default rank of 10. So the enum is skipped, and void is emitted instead
> as a no-op.
>
> Skip by type ID rather than by position.
>
> Fixes: 94133cf24bb3 ("bpftool: Introduce btf c dump sorting")
> Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
> ---
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
...
next prev parent reply other threads:[~2026-08-20 20:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 0:06 [PATCH bpf-next v1 0/4] bpftool, selftests: Add tests for C dump and fix a dropped type Ihor Solodrai
2026-08-20 0:06 ` [PATCH bpf-next v1 1/4] selftests/bpf: NUL-terminate bpftool command output Ihor Solodrai
2026-08-20 18:43 ` Eduard Zingerman
2026-08-20 0:06 ` [PATCH bpf-next v1 2/4] selftests/bpf: Add tests for bpftool btf dump format c Ihor Solodrai
2026-08-20 0:16 ` sashiko-bot
2026-08-20 0:51 ` bot+bpf-ci
2026-08-20 19:09 ` Eduard Zingerman
2026-08-20 21:01 ` Ihor Solodrai
2026-08-20 0:06 ` [PATCH bpf-next v1 3/4] bpftool: Don't drop a type in the sorted C dump Ihor Solodrai
2026-08-20 20:47 ` Eduard Zingerman [this message]
2026-08-21 0:18 ` Andrii Nakryiko
2026-08-20 0:06 ` [PATCH bpf-next v1 4/4] selftests/bpf: Check that sorting preserves types in bpftool dump Ihor Solodrai
2026-08-20 20:42 ` Eduard Zingerman
2026-08-20 20:58 ` Ihor Solodrai
2026-08-20 21:25 ` Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=478fbefa108d7da8eb28897998857ab72467b276.camel@gmail.com \
--to=eddyz87@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=ihor.solodrai@linux.dev \
--cc=memxor@gmail.com \
--cc=qmo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.