trace_puts(9)
πΈ trace_puts β like, the ftrace string-dropper β¨
okay so first things first, bestie: this is a page from the Kernel API Manual (section 9, kernel developer land π
), and today's main character is trace_puts. Let's get into it π«Ά
β¨ NAME β¨
trace_puts β write a string into the ftrace buffer π
π SYNOPSIS π
trace_puts (str );
that's it. that's the whole vibe. one arg, one string, one buffer. slay π
π¦ ARGUMENTS π¦
strβ the string to record. literally just the string, no cap. that's what goes in the buffer β¨
π NOTE π
okay so this is the part where I need you to lock in π₯
__trace_bputsis an internal function fortrace_puts, and theipgets passed in via thetrace_putsmacro. iykyk π- This thing is similar to
trace_printk, but it's made for those really fast paths where a developer wants the least amount of "Heisenbug" effects β like, the processing of the print format is still too much for that situation π - What this function does is let a kernel developer debug fast path sections that
printkis just not appropriate for. By scattering various printk-like tracing around in the code, a developer can quickly see where problems are occurring. it's giving "sprinkle a little detective work" π - Now the serious bit, and I mean it: this is intended as a debugging tool for the developer only. Please refrain from leaving
trace_putsscattered around in your code. π (Extra memory is used for special buffers that are allocated whentrace_putsis used β so yeah, it's not free, bestie.)
fr fr, don't ship it. debug with it, then take it out. we've all seen code with random trace calls left in it and we do NOT want that to be you π
β RETURN β
0if nothing was written- a positive # if the string was written β¨
and to be precise about that positive number, because details matter:
1when__trace_bputsis usedstrlen(str)when__trace_putsis used
π SEE ALSO π
- Kernel file
./include/linux/trace_printk.h trace_printk(9)
that's the whole page, bestie, go forth and debug responsibly π§ββοΈ
sign-off era: this lil page lives in ./include/linux and it's dated October 2026 β take that info and keep it safe in your notes ππ
π¦ 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