Skip to content

fix: correct pt_regs offset for kernel unwind#11352

Merged
rvql merged 1 commit intomainfrom
fix-arm-v8-dwarf
Feb 9, 2026
Merged

fix: correct pt_regs offset for kernel unwind#11352
rvql merged 1 commit intomainfrom
fix-arm-v8-dwarf

Conversation

@kylewanginchina
Copy link
Contributor

@kylewanginchina kylewanginchina commented Feb 3, 2026

One or more of:

  • Agent

Fixes incorrect pt_regs offset in kernel unwind on Linux 5.15+ (c4cf55e)

Steps to reproduce the bug

  • Run the continuous profiler on a Linux 5.15+ kernel with DWARF/unwind enabled
  • Observe invalid or incorrect user-mode registers/stacks during kernel unwind (e.g., invalid FP or
    broken stacks)

Changes to fix the bug

  • Add a 5.15+ perf-profiler BPF build variant and select it at runtime based on kernel version
  • Define helper IDs and wrappers for bpf_get_current_task_btf and bpf_task_pt_regs
  • Use bpf_task_pt_regs (with BTF-typed task pointer) to read user pt_regs on 5.15+ and keep the old
    path as fallback

Affected branches

  • main

Checklist

  • Added unit test to verify the fix.
  • Verified eBPF program runs successfully on linux 4.14.x.
  • Verified eBPF program runs successfully on linux 4.19.x.
  • Verified eBPF program runs successfully on linux 5.2.x.
  • Verified eBPF program runs successfully on linux 5.4.x.
  • Verified eBPF program runs successfully on linux 5.15.x.

@kylewanginchina kylewanginchina force-pushed the fix-arm-v8-dwarf branch 4 times, most recently from 822f56a to c4cf55e Compare February 6, 2026 08:25
@rvql rvql enabled auto-merge (rebase) February 9, 2026 10:06
@rvql rvql merged commit 5571287 into main Feb 9, 2026
8 checks passed
@rvql rvql deleted the fix-arm-v8-dwarf branch February 9, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments