Rust: Add nvtx-sys tools feature exposing the tools/injection ABI#170
Open
mbrobbel wants to merge 1 commit into
Open
Rust: Add nvtx-sys tools feature exposing the tools/injection ABI#170mbrobbel wants to merge 1 commit into
nvtx-sys tools feature exposing the tools/injection ABI#170mbrobbel wants to merge 1 commit into
Conversation
nvtx-sys tools feature exposing the tools/injection ABI
evanramos-nvidia
suggested changes
Jul 16, 2026
evanramos-nvidia
left a comment
Contributor
There was a problem hiding this comment.
We will need to see a concrete use case for this before we consider merging it.
Also, please see CONTRIBUTING.md.
Allowlist the callback-subscription types, function-table slot signatures, and injection result codes from nvtxDetail/nvtxTypes.h behind a new (default-off) tools feature. Default bindings are unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Matthijs Brobbel <m1brobbel@gmail.com>
Member
Author
|
willkill07
reviewed
Jul 18, 2026
willkill07
left a comment
Member
There was a problem hiding this comment.
This seems sensible to me. Exposition within the nvtx-sys crate should be viewed as safe in the general case.
We can be more critical of the end-user interface which builds upon it.
willkill07
approved these changes
Jul 20, 2026
|
merge ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a default-off
toolsfeature tonvtx-systhat extends the existing bindgen allowlist with the NVTX tools/injection ABI fromnvtxDetail/nvtxTypes.h:NvtxExportTableCallbacks,NvtxExportTableVersionInfo,NvtxExportTableID,NvtxCallbackModule, all sixNvtxCallbackId*enums,NvtxGetExportTableFunc_t,NvtxInitializeInjectionNvtxFunc_t,NvtxFunctionPointer, andNvtxFunctionTable.*_impl_fntype/*_fakeimpl_fntype) and the dependency-free fake types they reference (nvtx_CUdevice,nvtx_cl_*, ...), so tools cast slots to header-defined signatures instead of hand-maintained ones.NVTX_SUCCESS,NVTX_FAIL,NVTX_ERR_*).Why
Rust tools (injection libraries) currently have to run their own bindgen pipeline against the NVTX headers to get these types. Since
nvtx-sysalready generates bindings from the in-repo headers, exposing the tools ABI behind an opt-in feature lets tools depend onnvtx-sysdirectly.This is the first of a series: follow-ups add subscriber support to the
nvtxcrate on top of this feature.Notes
toolsdisabled, the generated bindings are byte-identical to before (verified by diffing generatedbindings.rs); with it enabled they are a strict superset.nvtxTypes.h(it is included even underNVTX_NO_IMPL), so this only changes the allowlist/blocklist: the.*fntype.*blocklist now applies only whentoolsis off.Verification
check.shprofiles pass: fmt, check/clippy-Dwarningsand tests for--all-features,--no-default-features(±alloc), MSRV 1.77, and thethumbv7em-none-eabino-default check; plus--features toolsalone andtools,cuda,cuda_runtime.🤖 Generated with Claude Code