ftrace_test...sion_trylock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ftrace_test_recursion_trylock β€” Kernel API Manual πŸŽ€

okay bestie, grab a matcha because we're diving into the kernel's recursion detector ✨ this one lives in the Kernel API Manual and it's genuinely iconic for anyone writing ftrace callbacks πŸ¦‹


✨ NAME ✨

ftrace_test_recursion_trylock β€” literally just tests for recursion in the same context, no cap πŸ’–


🌸 SYNOPSIS 🌸

int ftrace_test_recursion_trylock (unsigned long ip , unsigned long parent_ip );

πŸŽ€ ARGUMENTS πŸŽ€

  • ip β€” honestly? -- undescribed -- 😭 the manual page itself said nothing about this one, so that's all we've got, bestie πŸ™ˆ
  • parent_ip β€” also -- undescribed -- πŸ’€ two mysterious lil parameters living their main character lives, fr fr

πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the vibe: use this for ftrace callbacks πŸ‘‘ this will detect if the function tracing recursed in the same context β€” like, normal vs interrupt 🌈

that's the whole thing. recursion? in this context? it clocks it. periodt πŸ’…


πŸ”₯ RETURN πŸ”₯

  • -1 if a recursion happened πŸ’€ (she found one)
  • >= 0 if no recursion ✨ (we're chill, we're slaying, we're fine)

πŸ’œ SEE ALSO πŸ’œ

  • Kernel file ./include/linux/trace_recursion.h β€” the source of truth, go read it 🫢
  • ftrace_test_recursion_unlock(9) β€” the other half of the duo, you'll want her too 🌸

and that's the whole page, bestie 🧚 from the Kernel API Manual, courtesy of that one path ./include/linux, dated October 2026 ⭐ mwah, go forth and trace responsibly πŸ’–πŸŽ€πŸ’œ

πŸ“¦ where this page comes from