STRUCT KFD_IOCTL_DBG_TRAP_ENABLE_ARGS(9)
π struct kfd_ioctl_dbg_trap_enable_args(9) π
okay bestie, welcome to the Kernel API Manual β this is the page for struct kfd_ioctl_dbg_trap_enable_args, and yes it's a whole mouthful but we're gonna get through it together π
β¨ NAME β¨
struct kfd_ioctl_dbg_trap_enable_args β literally just the arguments for KFD_IOC_DBG_TRAP_ENABLE. that's the whole vibe. that's the name. π¦
πΈ SYNOPSIS πΈ
struct kfd_ioctl_dbg_trap_enable_args {
__u64 exception_mask;
__u64 rinfo_ptr;
__u32 rinfo_size;
__u32 dbg_fd;
};
look at her. four fields. absolutely iconic structure design, no notes π
π Members π
exception_maskβ (IN) the exceptions that get raised to the debugger. this is your little wishlist of "pls tell me when this happens" π«Άrinfo_ptrβ (IN) pointer to the runtime info buffer (go look atkfd_runtime_info, iykyk)rinfo_sizeβ (IN/OUT) size of the runtime info buffer, in bytes. it goes in and comes back out, she's versatile like that β¨dbg_fdβ (IN) the fd that the KFD will notify the debugger with, for the raised exceptions set inexception_mask. (the original says "nofify," which is a typo, but she's our typo now π)
π₯ Description π₯
so what does this actually do? it enables a debug session for the target process. main character energy fr fr π
when you wanna shut it down again, call op KFD_IOC_DBG_TRAP_DISABLE in kfd_ioctl_dbg_trap_args. that's the off switch, don't forget it exists π
generic errors apply here too (peep kfd_dbg_trap_operations for the full set). it returns 0 on SUCCESS. on enable, it copies the KFD-saved kfd_runtime_info over to rinfo_ptr, and the size of the kfd_runtime that the KFD saved gets returned to you in rinfo_size. cute little info handoff π
and now the error girls, in a bullet list because we respect ourselves:
EBADFβ if the KFD cannot get a reference todbg_fdπEFAULTβ if the KFD cannot copy runtime info torinfo_ptrπEINVALβ if the target process is already debug enabled. like bestie, it's already on π
shoutout to kfd_dbg_trap_operations for the generic error lore β this page only covers the special ones, so don't come for me if you hit something else π
π SEE ALSO π
Kernel file ./include/uapi/linux/kfd_ioctl.h, plus the whole extended friend group:
struct kfd_ioctl_criu_args(9)enum kfd_ioctl_svm_op(9)enum kfd_ioctl_svm_attr_type(9)struct kfd_ioctl_svm_attribute(9)struct kfd_ioctl_svm_args(9)struct kfd_ioctl_set_xnack_mode_args(9)struct kfd_ioctl_runtime_enable_args(9)struct kfd_ioctl_dbg_trap_send_runtime_event_args(9)struct kfd_ioctl_dbg_trap_set_exceptions_enabled_args(9)struct kfd_ioctl_dbg_trap_set_wave_launch_override_args(9)struct kfd_ioctl_dbg_trap_set_wave_launch_mode_args(9)struct kfd_ioctl_dbg_trap_suspend_queues_args(9)struct kfd_ioctl_dbg_trap_resume_queues_args(9)struct kfd_ioctl_dbg_trap_set_node_address_watch_args(9)struct kfd_ioctl_dbg_trap_clear_node_address_watch_args(9)struct kfd_ioctl_dbg_trap_set_flags_args(9)struct kfd_ioctl_dbg_trap_query_debug_event_args(9)struct kfd_ioctl_dbg_trap_query_exception_info_args(9)struct kfd_ioctl_dbg_trap_queue_snapshot_args(9)struct kfd_ioctl_dbg_trap_device_snapshot_args(9)struct kfd_ioctl_dbg_trap_args(9)struct kfd_ioctl_pmc_settings(9)
and that's the page!! π this lil beauty lives in ./include/uapi/linux and it's stamped October 2026 β so like, future girlie behavior honestly. go forth and enable your debug sessions responsibly, bestie. slay π§β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms