Skip to content

docs(23-http): say where vmlinux.h comes from and what BTF it needs - #239

Open
yunwei37 wants to merge 2 commits into
mainfrom
fix/lesson23-btf-note
Open

yunwei37 wants to merge 2 commits into
mainfrom
fix/lesson23-btf-note

Conversation

@yunwei37

Copy link
Copy Markdown
Member

Fixes #118.

The report is that ecli fails with a missing-vmlinux/BTF error on a kernel built without CONFIG_DEBUG_INFO_BTF. Lesson 23 is where that bites, and it said nothing about BTF at all — grep -rn BTF src/23-http/ matched nothing before this.

The paragraph added names both halves, because they are different problems:

  • What the build actually consumes: VMLINUX := ../third_party/vmlinux/$(ARCH)/vmlinux.h, i.e. a header vendored in this repository (src/third_party/vmlinux/x86/vmlinux.h and the other arches), so make normally does not need BTF on the running kernel.
  • What to check when that is overridden: ls /sys/kernel/btf/vmlinux, the same check lesson 3 uses for fentry, plus bpftool btf dump … format c as the way to produce the header from a kernel that has it.

English and Chinese, same content. Docs only; no code or Makefile change.

The lesson says nothing about BTF, so a reader whose kernel has no
CONFIG_DEBUG_INFO_BTF=y gets the BPF step failing with a BTF error and no
statement of the cause. Lesson 3 documents the check for fentry; this adds
the same paragraph where lesson 23 actually builds, and names the vendored
header at src/third_party/vmlinux/<arch>/vmlinux.h that VMLINUX points at,
so a reader can tell whether the prerequisite applies to them at all.
Copilot AI balanced review requested due to automatic review settings November 28, 2026 14:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@yunwei37 yunwei37 removed the size/M label Nov 28, 2026

@yunwei37 yunwei37 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: merge after CI — docs only, and the paragraph answers the actual report

Reviewed the diff rather than the description.

The two facts it adds are both checkable and both correct. src/23-http/Makefile:19 is VMLINUX := ../third_party/vmlinux/$(ARCH)/vmlinux.h, and the header is vendored — git ls-tree -r main has 14 vmlinux* files under src/third_party/vmlinux/{x86,arm,arm64,…}. So the claim that a normal make does not need BTF on the host kernel is right, and it is the thing the report's reader could not have known. The second half (ls /sys/kernel/btf/vmlinux, then bpftool btf dump … format c) is the override path and is the same check lesson 3 already uses, so the tutorial stays consistent.

Where it is placed matters: inside "Compilation and Execution", after the source link and before the build commands, which is where a reader hits the failure.

One correction to the earlier comment on #118: it said "nothing in this repository sets or documents BTF_FILE_PATH". That variable name does not exist in the tree at all — the real mechanism is VMLINUX plus a vendored header, which is what this change documents. The comment's conclusion (a documentation gap in lesson 23) was right; its variable name was not.

English and Chinese carry the same content. Fences balanced in both.

AI patrol review

@yunwei37 yunwei37 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: merge after CI — the documentation now addresses the reported runtime failure as well as the build path.

Issue #118 is an ecli skeleton-open failure, not a C compilation failure. The loader's bpf-loader-rs/bpf-loader-lib/src/skeleton/builder.rs passes BTF_FILE_PATH to libbpf as btf_custom_path; a generated vmlinux.h is not a replacement for that runtime input. The previous wording conflated these two paths.

Pushed a focused bilingual correction in 6860687: explain the vendored header and make VMLINUX=... separately from supplying matching target-kernel BTF to ecli. Also clarify the container case and link to the loader documentation. Verified both changed sections against the Makefile and loader source, and checked the commit diff is limited to the two lesson README files. No executable code changed. The previous head's green checks do not validate this new head; wait for the new documentation checks.

AI patrol review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]使用ecli运行时提示找不到 vmlinux BTF

2 participants