arch_stack_walk(9)
πΈ arch_stack_walk(9) β the Kernel API Manual, bestie edition πΈ
okay so this is arch_stack_walk(9) from the Kernel API Manual, and it's lowkey one of those pages that's short but loaded, yk? it's the arch-specific function that walks the stack. that's the whole vibe. stack walking, but make it architecture specific π
β¨ SYNOPSIS β¨
void arch_stack_walk (stack_trace_consume_fn consume_entry , void
*cookie , struct task_struct *task , struct pt_regs *regs );
like, yes, that's the whole signature. four args. no cap, that's it. π«Ά
π ARGUMENTS π
consume_entryβ this is the callback, and the architecture code invokes it for each and every entry it finds. every single one. it's giving "main character energy" but for stack frames πcookieβ a caller-supplied pointer that gets handed straight back toconsume_entry. it's literally a little care package you give the callback. you pack it, you get it back πtaskβ pointer to atask_struct. and yes, it can beNULL. no pressure.regsβ pointer to registers. also can beNULL. the bar is on the floor and honestly? we respect it π
π¦ DESCRIPTION π¦
so the page draws this adorable little grid, and I'm gonna reproduce it character for character because it's iconic in a chaotic way:
βββββββββββββββββββ
β task regs β
βββββββββββββββββββ
task NULL Stack trace from task (can be current) current
regs Stack trace starting on regs->stackpointer
the way that box is just sitting there holding task and regs like two little labels π§ and then the lines underneath are doing the actual explainer work:
taskwithNULLβ stack trace from task (and the task can becurrent, fr fr)regsβ stack trace starting onregs->stackpointerβ
that's the whole description. short, sweet, slays, done. periodt.
π SEE ALSO π
- the Kernel file
./include/linux/stacktrace.hβ go read it, it's literally right there π stack_trace_consume_fn(9)β the callback type from the arguments, bestie, look it up πarch_stack_walk_reliable(9)β the reliable sibling. yes, the naming is a little shady, no, we're not gonna talk about it π
ngl, if you're here you're probably debugging something cursed. good luck. you got this. π
and that's the page!! cute little sign-off for you: it comes from the source/version ./include/linux, dated October 2026, and the footer is literally just arch_stack_walk(9) again because manpages love a callback. mwah ππ
π₯
π¦ 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