linux-kernel: T8496: Add kernel config needed for PWRU - #1170
Conversation
PWRU (https://github.com/cilium/pwru) is a very useful tool to debug complex networking issues on Linux, as it allows you to trace how packets travel through the kernel functions
📝 WalkthroughSummary by CodeRabbit
WalkthroughA new Linux kernel configuration fragment for PWRU is added, enabling debug information, BTF debug info, and required tracing and BPF capabilities including kprobes, perf events, and function tracing. Changes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
👍 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/package-build/linux-kernel/config/30-pwru.config (1)
9-14: Track artifact-size/build-time impact in CI for DEBUG_INFO+BTF.This is a sensible change for PWRU, but these flags can materially increase kernel build time and debug artifact size. Consider adding/monitoring CI thresholds so regressions are caught early.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@scripts/package-build/linux-kernel/config/30-pwru.config` around lines 9 - 14, Add CI tracking for the DEBUG_INFO+BTF kernel config change: create a CI job (e.g. "linux-kernel-debug-info-btf") that builds the kernel with CONFIG_DEBUG_INFO=y, CONFIG_DEBUG_INFO_BTF=y and CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y, record build time and output artifact sizes (vmlinux, debug tarballs), and assert thresholds (or fail the job) when regressions exceed predefined limits; update CI config to store and graph these metrics so future changes to CONFIG_DEBUG_INFO or CONFIG_DEBUG_INFO_BTF are automatically monitored and alerts are raised on regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@scripts/package-build/linux-kernel/config/30-pwru.config`:
- Around line 9-14: Add CI tracking for the DEBUG_INFO+BTF kernel config change:
create a CI job (e.g. "linux-kernel-debug-info-btf") that builds the kernel with
CONFIG_DEBUG_INFO=y, CONFIG_DEBUG_INFO_BTF=y and
CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y, record build time and output
artifact sizes (vmlinux, debug tarballs), and assert thresholds (or fail the
job) when regressions exceed predefined limits; update CI config to store and
graph these metrics so future changes to CONFIG_DEBUG_INFO or
CONFIG_DEBUG_INFO_BTF are automatically monitored and alerts are raised on
regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fae2d8e0-ae77-4f6b-b8da-9d45ddb01f09
📒 Files selected for processing (1)
scripts/package-build/linux-kernel/config/30-pwru.config
📜 Review details
🧰 Additional context used
🔍 Remote MCP
Summary: Additional Context for PWRU Kernel Configuration PR Review
PWRU Tool Overview
PWRU ("Packet, where are you?") is an eBPF-based tool for tracing network packets in the Linux kernel with advanced filtering capabilities. Under the hood, pwru attaches eBPF debugging programs to all Linux kernel functions which are responsible for processing network packets, providing a finer-grained view into packet processing in the kernel than with traditional tools like tcpdump or Wireshark.
Kernel Requirements for PWRU
PWRU requires >= 5.3 kernel to run, >= 5.9 kernel for --output-skb, and >= 5.18 kernel for --backend=kprobe-multi. The test kernel referenced in the PR (6.6.135-vyos+test2) meets these requirements.
BTF (BPF Type Format) - Critical for PWRU
BTF (BPF Type Format) is the metadata format which encodes the debug info related to BPF program/map. BTF was extended to include function info for defined subroutines and line info for source/line information. The debug info is used for map pretty print, function signature, etc.
Tetragon (a related Cilium security observability tool) needs BTF support, and CO-RE allows portability of BPF programs but requires a kernel with BTF enabled. Most common Linux distributions now ship with BTF enabled via CONFIG_DEBUG_INFO_BTF=y.
It is now practical to have Linux kernel with always present embedded BTF type information at runtime by building the kernel with CONFIG_DEBUG_INFO_BTF=y option.
Kernel Configuration Requirements
The PR adds standard kernel configuration options needed for eBPF-based tracing:
- CONFIG_DEBUG_INFO=y with DWARF version delegated to toolchain: Provides symbol information essential for function tracing
- CONFIG_DEBUG_INFO_BTF=y: Enables embedded BTF metadata at runtime, critical for PWRU's portable BPF programs
- Kprobes, perf events, BPF, and function tracer: These are standard eBPF requirements (CONFIG_BPF_EVENTS, CONFIG_BPF_SYSCALL, CONFIG_PERF_EVENTS) that enable attaching BPF programs to kernel function entry points
[::web_search::]
🔇 Additional comments (1)
scripts/package-build/linux-kernel/config/30-pwru.config (1)
3-20: Good config override pattern for enabling PWRU prerequisites.Using
# CONFIG_DEBUG_INFO_NONE is not setplus explicitCONFIG_DEBUG_INFO=y/CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=yand the tracing/BPF flags is the right approach for this fragment-based merge flow.
sever-sever
left a comment
There was a problem hiding this comment.
It allows eBPF-based tools for tracing network packets in the Linux kernel
c-po
left a comment
There was a problem hiding this comment.
Will increase Kernel size but according to research no noticeable runtime degradation when not in use.
|
One thing we might have to check is that the As far as I've understood, the -dbg package is not required and the BTF info is embedded in the kernel itself, the -dbg package contains the full debug info. |
PWRU (https://github.com/cilium/pwru) is a very useful tool to debug complex networking issues on Linux, as it allows you to trace how packets travel through the kernel functions
Change summary
This PR adds the kernel flags required for PWRU
Types of changes
Related Task(s)
https://vyos.dev/T8496
Related PR(s)
How to test / Smoketest result
Checklist: