STRUCT KFD_IOCTL_DBG_TRAP_DEVICE_SNAPSHOT_ARGS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct kfd_ioctl_dbg_trap_device_snapshot_args(9) β€” from the Kernel API Manual, bestie ✨

okay so picture this: you're in the Kernel API Manual section 9, and this is the lil struct that carries all the args for KFD_IOC_DBG_TRAP_GET_DEVICE_SNAPSHOT. giving very much "backstage pass to the debug trap" energy πŸŽ€


✨ NAME ✨

struct kfd_ioctl_dbg_trap_device_snapshot_args β€” the arguments struct for KFD_IOC_DBG_TRAP_GET_DEVICE_SNAPSHOT. that's it, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

struct kfd_ioctl_dbg_trap_device_snapshot_args {
    __u64 exception_mask;
    __u64 snapshot_buf_ptr;
    __u32 num_devices;
    __u32 entry_size;
 };

look at her. four fields. flawless. no notes 🫢


πŸ¦‹ Members πŸ¦‹

bestie we're gonna go through each field one by one, no skipping, we do NOT skip in this house πŸ’–

  • exception_mask β€” (IN) β€” the exceptions raised to clear. that's the whole job. it goes in, it masks, it slays.
  • snapshot_buf_ptr β€” (IN) β€” pointer to the snapshot buffer (peep kfd_dbg_device_info_entry for what's actually living in there πŸ‘€).
  • num_devices β€” (IN/OUT) β€” number of debug devices to snapshot. so here's the deal: the debugger specifies the size of the array it allocated in num_devices. then KFD comes back and tells you the number of devices that actually existed. and if that number is larger than what the debugger specified, KFD will not overflow the array the debugger allocated. iconic behaviour honestly, very "we protect you" of it 🧚
  • entry_size β€” (IN/OUT) β€” size per entry in bytes. the debugger specifies sizeof(struct kfd_dbg_device_info_entry) in entry_size. KFD then returns the number of bytes actually populated. the debugger should use KFD_IOCTL_MINOR_VERSION to determine which fields in struct kfd_dbg_device_info_entry are valid β€” which is the whole trick for growing the ABI in a backwards compatible manner, iykyk 😌. and NOTE, bestie, important: entry_size(IN) should still be used to stride the snapshot buffer in the event that it's larger than actual kfd_dbg_device_info_entry. do not forget that or it's giving chaos.

πŸ”₯ Description πŸ”₯

Get device information. simple as that. main character errand πŸ’…

Generic errors apply (see kfd_dbg_trap_operations). Return - 0 on SUCCESS.

So: copies num_devices(IN) device snapshot entries of size entry_size(IN) into snapshot_buf_ptr if num_devices(IN) > 0. Otherwise? returns num_devices(OUT) queue snapshot entries that exist. periodt 🌟


🌈 SEE ALSO 🌈

the whole friend group, fr fr:

  • 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_queue_snapshot_args(9)
  • struct kfd_ioctl_dbg_trap_args(9)
  • struct kfd_ioctl_pmc_settings(9)

okay that's the whole page, ily, go read your device snapshots responsibly πŸ“

sourced straight out of ./include/uapi/linux β€” October 2026 edition, struct kfd_i...napshot_args(9), xoxo πŸ’œβœ¨

πŸ“¦ where this page comes from