ftrace_graph_get_ret_stack(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ftrace_graph_get_ret_stack β€” a Kernel API Manual moment

okay so bestie, gather round, because we're diving into the Kernel API Manual and this one is genuinely iconic if you're into shadow stacks (and honestly? who isn't). It's ftrace_graph_get_ret_stack(9) and it's giving "small function, big responsibility" energy.

✨ NAME ✨

ftrace_graph_get_ret_stack β€” return the entry of the shadow stack 🫢

✨ SYNOPSIS ✨

struct ftrace_ret_stack * ftrace_graph_get_ret_stack (struct task_struct
*task , int idx );

✨ ARGUMENTS ✨

  • task β€” the task you wanna read the shadow stack from. like, which one of your little guys are we snooping on πŸ’–
  • idx β€” index down the shadow stack. it's the "how far back are we going" number, no cap.

✨ DESCRIPTION ✨

So here's the tea β˜•: this returns the ret_struct on the task's shadow stack, at the call graph position idx, and idx starts at zero. Simple as that.

  • if idx is zero, you get the last saved ret_stack entry. the freshest one. the most recent vibe. ✨
  • if idx is greater than zero, you get the corresponding ret_stack for the depth of saved return addresses. like going down the stack of history, one level at a time πŸ¦‹

that's literally the whole thing. zero = most recent, bigger = deeper. iykyk πŸ’…

🌈 SEE ALSO 🌈


and that's the whole page, bestie, go forth and read those shadow stacks πŸ‘‘

sign-off vibes only: this little icon lives in ./kernel/trace and it's stamped October 2026 β€” periodt, that's the version and date, mwah πŸŽ€πŸ’œ

πŸ“¦ where this page comes from