STRUCT KFD_IOCTL_DBG_TRAP_QUEUE_SNAPSHOT_ARGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct kfd_ioctl_dbg_trap_queue_snapshot_args(9) πŸ’œ

okay so real talk, this is straight out of the Kernel API Manual, section 9, and the page is literally called struct kfd_ioctl_dbg_trap_queue_snapshot_args. yes bestie that's a whole mouthful, i know, but stick with me because it's actually so good 🫢


✨ NAME ✨

struct kfd_ioctl_dbg_trap_queue_snapshot_args β€” the argument struct for KFD_IOC_DBG_TRAP_GET_QUEUE_SNAPSHOT. it's giving "the little envelope that carries your queue-snapshot request," and honestly? iconic πŸ’…


🌸 SYNOPSIS 🌸

struct kfd_ioctl_dbg_trap_queue_snapshot_args {
    __u64 exception_mask;
    __u64 snapshot_buf_ptr;
    __u32 num_queues;
    __u32 entry_size;
 };

four fields. that's it. that's the whole vibe check, and it passed with flying colors ⭐


πŸŽ€ Members πŸŽ€

  • exception_mask β€” this one is (IN), and it's all about the exceptions raised to clear. lowkey the cleanup crew of the struct 🧹
  • snapshot_buf_ptr β€” (IN), and it points at your queue snapshot entry buffer (peep kfd_queue_snapshot_entry for the deets). it's the address where the good stuff lands πŸ“
  • num_queues β€” (IN/OUT), the number of queue snapshot entries. here's the tea: the debugger specifies the size of the array it allocated in num_queues, and then KFD comes back and returns the number of queues that actually existed. and if that's bigger than what the debugger said? KFD will not overflow the array the debugger allocated. no cap, it's polite like that πŸ™ˆ
  • entry_size β€” (IN/OUT), size per entry in bytes. the debugger plops sizeof(struct kfd_queue_snapshot_entry) into entry_size, and KFD returns the number of bytes actually populated per entry. the debugger should use KFD_IOCTL_MINOR_VERSION to figure out which fields in struct kfd_queue_snapshot_entry are valid β€” that's how you grow an ABI in a backwards compatible manner, slay πŸ’…. heads up though: entry_size(IN) should still be used to stride the snapshot buffer in the event that it's larger than actual kfd_queue_snapshot_entry. don't skip that part bestie, it matters πŸ”₯

πŸ¦‹ Description πŸ¦‹

get queue information. that's the whole mission, and it ate πŸ’–

generic errors apply (go see kfd_dbg_trap_operations). returns - 0 on SUCCESS.

so here's the flow, literally step by step:

  • it copies num_queues(IN) queue snapshot entries of size entry_size(IN) into snapshot_buf_ptr if num_queues(IN) > 0
  • otherwise it returns num_queues(OUT) queue snapshot entries that exist

like, either you hand it a buffer and it fills it, or you hand it nothing and it tells you how many exist. main character energy either way πŸ‘‘


🌈 SEE ALSO 🌈

  • Kernel file ./include/uapi/linux/kfd_ioctl.h
  • 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_debug_event_args(9)
  • struct kfd_ioctl_dbg_trap_query_exception_info_args(9)
  • struct kfd_ioctl_dbg_trap_device_snapshot_args(9)
  • struct kfd_ioctl_dbg_trap_args(9)
  • struct kfd_ioctl_pmc_settings(9)

that's a whole friend group right there, go say hi 🫢


and that's the whole page bestie!! πŸ’œ this one came from ./include/uapi/linux, dated October 2026, and it's filed under struct kfd_...napshot_args(9) in your friendly neighborhood Kernel API Manual. now go snapshot some queues, you absolute legend πŸŽ€βœ¨

πŸ“¦ where this page comes from