Skip to content

runtime: support bpf_ktime_get_boot_ns - #609

Open
yunwei37 wants to merge 2 commits into
masterfrom
fix/ktime-get-boot-ns-helper
Open

runtime: support bpf_ktime_get_boot_ns#609
yunwei37 wants to merge 2 commits into
masterfrom
fix/ktime-get-boot-ns-helper

Conversation

@yunwei37

Copy link
Copy Markdown
Member

Summary

  • implement and register helper ID 125 (bpf_ktime_get_boot_ns)
  • use CLOCK_BOOTTIME, with CLOCK_MONOTONIC as a portability fallback
  • exercise the helper through the LLVM JIT helper regression program

Fixes #608

Validation

  • cmake -B build -DCMAKE_BUILD_TYPE=Release -DBPFTIME_ENABLE_LTO=NO -DBPFTIME_LLVM_JIT=YES -DBPFTIME_ENABLE_UNIT_TESTING=1
  • cmake --build build --target bpftime_runtime_tests -j$(nproc)
  • ./build/runtime/unit-test/bpftime_runtime_tests 'Test helpers' (1 test case, 5 assertions passed)
  • full runtime test binary: helper regression passed; 75/77 test cases passed, with the two remaining failures requiring host filesystem/kernel BPF privileges (Test shm progs attach, Test tail calling from userspace to kernel)

@yunwei37

yunwei37 commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

Exact-head review is complete for 8c6e281.

The first pass identified a runtime edge case where CLOCK_BOOTTIME could be available at compile time but rejected by the running kernel. Commit 8c6e281 resolves it by zero-initializing the result and falling back to CLOCK_MONOTONIC on failure. Two final independent reviews found no blocking issues: helper ID/signature/registration are correct, the LLVM JIT regression covers the original unresolved-helper path, and the two-file 20-line scope remains minimal.

The focused test was rebuilt and rerun on the final head: 1 test case and 5 assertions passed. CI has now reached a terminal state with 141 successful checks, 2 expected skips, and no failed checks. The two GPU jobs were cancelled after waiting for unavailable self-hosted runners without executing any repository steps. The PR is mergeable and has no unresolved review threads; the remaining decisions are GPU-runner availability and maintainer review.

AI-generated response; a maintainer will review and follow up later

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] llvm-jit cannot find bpf helper when bpftime trying to attach to running process

2 participants