Support vmlinux.inline if CONFIG_DEBUG_INFO_BTF_INLINE is enabled

Open Beginner friendly
#2,152 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
go, linux
Domain
backend

Research direction

The failure comes from the module-name filter in the kernel BTF loading path; the proposed fix sits where loadKernelModuleSpec() is called over the /sys/kernel/btf entries. Start by reproducing with go test -run '^$' -bench '^BenchmarkNewCollectionManyProgs$' -benchtime 1x . on a kernel with CONFIG_DEBUG_INFO_BTF_INLINE=y. Done means the benchmark passes, .inline entries are skipped, and the existing BTF module loading tests still pass.

Written by the indexing model from the issue text.

Description

Description

Linux 7.4 adds CONFIG_DEBUG_INFO_BTF_INLINE (torvalds/linux@672981f4ae, in v7.4-rc1). With it set, /sys/kernel/btf also holds vmlinux.inline, plus <module>.inline for modules(torvalds/linux@42d7153fcb). These files hold split BTF that describes inlined call sites.

How to reproduce
  1. Build a kernel from v7.4-rc1 or bpf-next with CONFIG_DEBUG_INFO_BTF=y
    and CONFIG_DEBUG_INFO_BTF_INLINE=y, using pahole 1.32 or newer. After
    boot, ls /sys/kernel/btf shows vmlinux vmlinux.inline.

  2. On that kernel, as root, from a checkout of cilium/ebpf, run an existing
    benchmark that loads a CO-RE object:

    go test -run '^$' -bench '^BenchmarkNewCollectionManyProgs$' -benchtime 1x .
    
    BenchmarkNewCollectionManyProgs
        collection_test.go:608: program kprobe_execve3: apply CO-RE relocations: load BTF for kmod vmlinux.inline: invalid module name "vmlinux.inline"
    --- FAIL: BenchmarkNewCollectionManyProgs
    

Proposed fix: skip the names that loadKernelModuleSpec() refuses.

 	entries = slices.DeleteFunc(entries, func(s string) bool {
-		return s == "vmlinux"
+		return s == "vmlinux" || filepath.Ext(s) != ""
 	})

Happy to open a PR with it.

Version information

github.com/cilium/ebpf v0.22.1-0.20260708150823-a5b2e206f9ed (also reproduced on main at 6951718af7)

Dominant language
Go
Stars
8k
Forks
903
Avg merge
3d 15h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cilium/ebpf

All issues in cilium/ebpf

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.