unwind_deferred_request(9)
β¨ 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 π
- Kernel file
./kernel/unwind/deferred.c unwind_user_faultable(9)
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
- 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