STRUCT DMA_DEBUG_ENTRY(9)
π struct dma_debug_entry(9) β the Kernel API Manual, bestie edition π
okay so this is struct dma_debug_entry, and it lives in the Kernel API Manual. iykyk. its whole entire job? it tracks a dma_map* or dma_alloc_coherent mapping π
like that's literally the assignment and it ate.
β¨ SYNOPSIS β¨
here's the shape of it, no cap, copy it exactly:
struct dma_debug_entry {
struct list_head list;
struct device *dev;
u64 dev_addr;
u64 size;
int type;
int direction;
int sg_call_ents;
int sg_mapped_ents;
phys_addr_t paddr;
enum map_err_types map_err_type;
unsigned long attrs;
#ifdef CONFIG_STACKTRACE;
unsigned int stack_len;
unsigned long stack_entries[DMA_DEBUG_STACKTRACE_ENTRIES];
#endif;
};
πΈ Members πΈ
breaking it down field by field because every single one of these matters, bestie:
listβ this is the node on the pre-allocatedfree_entrieslist π¦ it's giving backstage pass.devβ the device. that's it, that's the field πdev_addrβ the dma address β¨sizeβ the length of the mapping, aka how much we're working with πtypeβ one ofsingle,page,sg,coherentβ pick your fighter πdirectionβ anenum dma_data_direction, obviously πsg_call_entsβ sg call entries, it's right there in the name πsg_mapped_entsβ sg mapped entries, same vibe, different field πpaddrβ physical start address of the mapping, lowkey important βmap_err_typeβ this one tracks whetherdma_mapping_errorwas checked π yes it's keeping receipts, that's the whole point πattrsβ dma attributes πstack_lenβ the number of backtrace entries instack_entriesπ§stack_entriesβ the stack of backtrace history, like a little scrapbook of where you've been ππ₯
real talk:stack_lenandstack_entriesare tucked inside#ifdef CONFIG_STACKTRACE, so if that's not on, these two are simply not invited to the function π«Ά
π SEE ALSO π
- Kernel file
./kernel/dma/debug.cβ go read it, it's the main character π
k that's the whole page, you're welcome π
sign-off time: this iconic lil doc comes from ./kernel/dma, dated October 2026, and it's filed under struct dma_debug_entry(9). slay, go map some dma safely, and remember to check your errors. periodt. πΈβ¨
π¦ 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