STRUCT KFD_IOCTL_DBG_TRAP_QUERY_DEBUG_EVENT_ARGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct kfd_ioctl_dbg_trap_query_debug_event_args β€” from the Kernel API Manual ✨

okay so bestie, welcome to the glossary entry for struct kfd_ioctl_dbg_trap_query_debug_event_args, and no I did NOT forget the manual name β€” it's straight out of the Kernel API Manual, we're fancy like that πŸ’…


✨ NAME ✨

struct kfd_ioctl_dbg_trap_query_debug_event_args</p> β€” literally the arguments you pass to KFD_IOC_DBG_TRAP_QUERY_DEBUG_EVENT. that's the whole job. iconic honestly 🫢


🌸 SYNOPSIS 🌸

struct kfd_ioctl_dbg_trap_query_debug_event_args {
    __u64 exception_mask;
    __u32 gpu_id;
    __u32 queue_id;
 };

look at her. four fields, zero drama, exactly as written. we stan a compact struct πŸŽ€


πŸ¦‹ Members πŸ¦‹

  • exception_mask β€” (IN/OUT) β€” bestie this one does double duty: the exception to clear goes in (IN), and the exception that got raised comes back out (OUT). she's giving main character energy, she's giving two jobs 😭
  • gpu_id β€” (OUT) β€” the gpu id of the exceptions that were raised ✨
  • queue_id β€” (OUT) β€” the queue id of the exceptions that were raised 🌈

πŸ’œ Description πŸ’œ

okay so what does it actually do? it finds one or more raised exceptions. and the slay part: this function can return multiple exceptions from a single queue, or from a single device, all in one single call. efficiency queen πŸ‘‘

but here's the catch, and I need you to hear me on this β€” to find all the raised exceptions, you have to call this thing repeatedly until it returns -EAGAIN. like, keep going. no skipping. you'll know you're done when you get that -EAGAIN. periodt πŸ’…

now, the returned exceptions can optionally be cleared by setting the corresponding bit in the exception_mask input parameter. cute, right?

⚠️ but bestie, WARNING, hear me: clearing an exception prevents retrieving further information about it with KFD_IOC_DBG_TRAP_QUERY_EXCEPTION_INFO. like you literally cannot get that info back afterwards. so think before you clear. no cap πŸ™ˆ

generic errors apply (see kfd_dbg_trap_operations).

return 0 on raised exception found β€” raised exceptions found are returned in the exception mask, with the reported source id returned in gpu_id or queue_id.

  • EAGAIN β€” if no raised exception has been found πŸ’€ (that's your "we're so done here" signal, bestie)

πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/uapi/linux/kfd_ioctl.h 🌸, plus the whole 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_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_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 whole page, bestie 🧚 no gatekeeping, no skipped fields, every last reference intact πŸ“

✨ mwah ✨ this one came from ./include/uapi/linux, dated October 2026 β€” so yeah, future-coded and flawless, go off πŸ’–πŸ¦‹β­

πŸ“¦ where this page comes from