feat: Basic-block & Register tracing & Trampoline update - #571
Conversation
| void nv_attach_impl::register_custom_helpers( | ||
| ebpf_helper_register_callback register_callback) | ||
| { | ||
| register_callback(501, "bpf_puts", (void *)bpftime_nv_helper_stub); |
There was a problem hiding this comment.
Registering here is not necessary. These functions are already registered at
|
|
CI fix. Need to check if it is a CI config problem. Parser verification will be after that |
|
CI triage update (2026-07-16): this PR has real GPU regressions, not just runner queueing. The failing checks show two distinct issues: (1) |
|
CI triage update: I found two real CUDA/PTX regressions in the available logs, separate from the current self-hosted runner queue issue:
This PR is also behind master and has conflicts, and its head branch is an external fork default branch. I did not push a fix because rewriting this branch from the maintainer side would be risky. Suggested fix direction after rebase/conflict resolution:
|
This pull request introduces significant improvements to the PTX attach and trampoline infrastructure, focusing on enhanced support for basic block (BB) tracepoints, improved PTX version compatibility, and better CUDA kernel function handling. The changes include a new pass for BB tracepoints, more robust fallback mechanisms for patched kernel launches, and a smarter PTX compiler that can automatically retry with a compatible version. Several device helper functions and build scripts have also been updated for modern CUDA support and reliability.
Key changes:
BB Tracepoint Support
ptxpass_bb_tracepoint, with its own CMake configuration and integration into the build system, enabling BB tracepoint instrumentation. (attach/nv_attach_impl/pass/ptxpass_bb_tracepoint/CMakeLists.txt,attach/nv_attach_impl/CMakeLists.txt) [1] [2]attach/nv_attach_impl/pass/ptxpass_kprobe_entry/main.cpp)CUDA Kernel Function Management
find_single_patched_kernel_function()to allow fallback to a single available patched kernel when multiple mappings are unavailable, improving late attach reliability. This fallback is now used in both CUDA runtime and driver API launch paths. (nv_attach_impl.cpp,nv_attach_impl.hpp,nv_attach_impl_frida_setup.cpp) [1] [2] [3] [4]nv_attach_impl.cpp) [1] [2]PTX Compiler Robustness
ptx_compiler.cpp) [1] [2] [3]ptx_compiler.cpp)Device Helper and Build System Updates
get_ptx_reg,get_reg_count) and updated device-side trampoline code for better argument preservation and atomic operations. (ptxpass_core/src/core.cpp,trampoline/default_trampoline.cu) [1] [2] [3] [4]nvccfor PTX generation, updated the default architecture tosm_75, and improved the documentation accordingly. (trampoline/Makefile,trampoline/README.md) [1] [2]Miscellaneous
<algorithm>and<cctype>to ensure portability and correctness. (nv_attach_impl.cpp,ptx_compiler.cpp) [1] [2]These changes collectively improve instrumentation flexibility, reliability of kernel patching, and compatibility with modern CUDA environments.