unwind_deferred_request(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ unwind_deferred_request(9) ✨

okay so bestie, this is a page from the Kernel API Manual and it's literally about unwind_deferred_request β€” the lil function that asks for a user stacktrace when a task exits the kernel πŸŽ€


🌸 NAME 🌸

unwind_deferred_request β€” request a user stacktrace on task kernel exit πŸ¦‹


πŸ’… SYNOPSIS πŸ’…

int unwind_deferred_request (struct unwind_work *work , u64 *cookie );

πŸŽ€ ARGUMENTS πŸŽ€

  • work β€” the unwind descriptor that's requesting the trace. it's giving "who's asking" energy ✨
  • cookie β€” the cookie of the first request made for this task. not a snack, but honestly? iconic either way πŸ“

πŸ’– DESCRIPTION πŸ’–

So what this does is schedule a user space unwind to be done in task work before exiting the kernel, no cap.

The returned cookie output is the generated cookie of the very first request for a user space stacktrace for this task, ever since it entered the kernel. and like β€” it can be from a request by any caller of this infrastructure, not just you. its value will also be passed to the callback function. you can use it to stitch kernel and user stack traces together in post-processing. main character cookie fr fr 🌈

It's totally valid to call this function multiple times for the same work within the same task entry context. each call will return the same cookie while the task hasn't left the kernel. and if the callback is not pending because it has already been previously called for the same entry context β€” it will be called again with the same stack trace and cookie. yes bestie, it comes back πŸ’€


πŸ”₯ RETURN πŸ”₯

  • 0 β€” if the callback successfully was queued βœ…
  • 1 β€” if the callback is pending or was already executed ⏳
  • Negative β€” if there's an error 😭

and cookie holds the cookie of the first request by any user πŸ‘‘


🌟 SEE ALSO 🌟


ngl if you got a negative number back, something went wrong and that's your cue to go look at the error 🫢

okay that's the whole vibe, bestie πŸ’œ this came to you from ./kernel/unwind, dated October 2026 β€” and that's the last line of the original, so consider it my cute sign-off 🧚✨

πŸ“¦ where this page comes from