Re: [RFC PATCH v2 02/30] unwind: Add KUnit tests for Minimal DWARF CFI interpreter
From: bot+bpf-ci
Date: Wed Nov 25 2026 - 02:05:31 EST
> unwind: Add KUnit tests for Minimal DWARF CFI interpreter
TL;DR: Nit only, in the KUnit tests: the same blob-derived arguments are
repeated in about 26 dwarf_cfi_eval_fde_kmem() calls; a small eval_blob()
helper could make them easier to scan.
> diff --git a/kernel/unwind/dwarf_cfi_kunit.c b/kernel/unwind/dwarf_cfi_kunit.c
> new file mode 100644
> --- /dev/null
> +++ b/kernel/unwind/dwarf_cfi_kunit.c
[ ... ]
> +static void test_cfi_drap_realigned_frame(struct kunit *test)
> +{
[ ... ]
> + build_test_eh_blob(&blob, "zR", 0x04, 0x2800, 0x40, insns, sizeof(insns));
> +
> + /* Transient prologue at 0x2806: DWARF_CFI_BASE_REG (r10) */
> + KUNIT_ASSERT_EQ(test, 0,
> + dwarf_cfi_eval_fde_kmem(blob.buf + blob.fde_off, blob.buf,
> + blob.buf + blob.total_len, 0x2806,
> + &test_x86_64_arch, &row));
this isn't a bug, but would a small helper such as eval_blob(&blob, pc,
arch, &row) make these tests easier to scan?
The same three blob-derived arguments (blob.buf + blob.fde_off, blob.buf,
blob.buf + blob.total_len) are spelled out in every
dwarf_cfi_eval_fde_kmem() call, across test_cfi_drap_realigned_frame(),
test_cfi_sigreturn_frame() and test_cfi_arm64_pac_and_riscv_leaf(), and
about 26 times in the file. Only the PC and the arch descriptor vary
between the calls.
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/45561209846