Re: [RFC PATCH bpf-next v5 6/8] selftests/bpf: extract BPF skeleton generation into a helper script

Eduard Zingerman <[email protected]>
Newsgroups org.kernel.vger.bpf
Message-ID <[email protected]>
On Tue, 2026-08-04 at 10:01 -0700, Mykola Lysenko wrote:
> The four skeleton generation recipes (regular, light, signed light and
> linked) are near-identical five-step pipelines - link via "bpftool gen
> object" three times, compare the second and third results as a
> regression test for bpftool's determinism, generate the skeleton (and
> possibly subskeleton), remove intermediates - duplicated with small
> variations inside DEFINE_TEST_RUNNER_RULES, where every line pays the
> double-expansion escaping tax.
> 
> Move the pipeline into gen_bpf_skel.sh; the differences between the
> four variants become the --lskel, --sign and --subskel flags. Signing
> takes the key and certificate from $PRIVATE_KEY and $VERIFICATION_CERT
> in the environment, like the bpftool binary comes from $BPFTOOL. The
> distinct linked/llinked intermediate infixes are kept but derived
> inside the script: tests listed in LSKELS_EXTRA generate both a
> .skel.h and a .lskel.h from the same .bpf.o, and distinct intermediate
> names are what keeps parallel builds from racing. Build-log messages
> stay in the recipes with the usual $(call msg,...) helpers; behavior
> is unchanged.
> 
> Suggested-by: Eduard Zingerman <[email protected]>
> Assisted-by: Claude:claude-fable-5 shellcheck
> Signed-off-by: Mykola Lysenko <[email protected]>
> ---

Acked-by: Eduard Zingerman <[email protected]>

I need to print this out and hang it at my desk.

  ┌────────────┬─────────────────┬───────────────────────────┬─────┐
  │ expression │     x unset     │           x=""            │ x=v │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x-D}     │ D               │ `` (empty)                │ v   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x:-D}    │ D               │ D                         │ v   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x+A}     │ ``              │ A                         │ A   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x:+A}    │ ``              │ ``                        │ A   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x=D}     │ D (and assigns) │ `` (no assign — x is set) │ v   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x:=D}    │ D (and assigns) │ D (and assigns)           │ v   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x?msg}   │ abort           │ ``                        │ v   │
  ├────────────┼─────────────────┼───────────────────────────┼─────┤
  │ ${x:?msg}  │ abort           │ abort                     │ v   │
  └────────────┴─────────────────┴───────────────────────────┴─────┘

...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.