STRUCT KFD_IOCTL_DBG_TRAP_ENABLE_ARGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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 at kfd_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 in exception_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 to dbg_fd πŸ’€
  • EFAULT β€” if the KFD cannot copy runtime info to rinfo_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