ftrace_bug(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ftrace_bug β€” a Kernel API Manual moment (section 9, bestie)

okay so this is ftrace_bug(9) from the Kernel API Manual, and it's literally the function that catches the function tracer mid-crisis and shuts the whole thing down. it's giving "we need to talk" energy 🫢


✨ NAME ✨

ftrace_bug β€” report and shutdown function tracer. yes bestie, both: it snitches AND it pulls the plug 😭


🌸 SYNOPSIS 🌸

void ftrace_bug (int failed , struct dyn_ftrace *rec );

πŸŽ€ ARGUMENTS πŸŽ€

  • failed β€” the failed type, and it's gotta be one of EFAULT, EINVAL, EPERM. no vibes-based error codes allowed πŸ™ˆ
  • rec β€” the record that failed. the actual struct dyn_ftrace that did the mess πŸ’€

πŸ¦‹ DESCRIPTION πŸ¦‹

so the arch code β€” the one that enables or disables the function tracing β€” can call ftrace_bug when it has detected a problem in modifying the code. that's the whole point of it, it's the "hey something went sideways while we were poking at instructions" hotline πŸ”₯

and failed should be one of either:

  • EFAULT β€” if the problem happens on reading the ip address πŸ‘€
  • EINVAL β€” if what is read at ip is not what was expected 😬
  • EPERM β€” if the problem happens on writing to the ip address 🚫

like, each code tells you where in the read/write dance things went wrong, iykyk. use the right one, don't just pick your fave πŸ’…


⭐ SEE ALSO ⭐

Kernel file ./kernel/trace/ftrace.c

like, that's the whole ftrace friend group right there, go say hi 🌈


ngl this whole page lives in ./kernel/trace and it's dated October 2026 β€” so yeah, this manual page is from the future and it's still out here documenting a bug reporter. main character energy fr fr πŸ‘‘βœ¨πŸ’œ
πŸ“¦ where this page comes from