tracing_log_err(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ tracing_log_err(9) β€” the Kernel API Manual, but make it bestie πŸ’…

okay so welcome to the tracing_log_err(9) page, from the Kernel API Manual ✨ this one's short and sweet and honestly kinda iconic β€” it's all about dropping an error into the tracing error log 🫢


✨ NAME ✨

tracing_log_err β€” write an error to the tracing error log πŸ“πŸ”₯


πŸ’– SYNOPSIS πŸ’–

void tracing_log_err (struct trace_array *tr , const char *loc , const
char *cmd , const char **errs , u8 type , u16 pos );

like yes bestie, that's the whole signature, no cap β€” copy it exactly, do not come for my formatting 😭


🌸 ARGUMENTS 🌸

  • tr β€” the associated trace array for the error, and yes it takes NULL for the top level array πŸ‘‘
  • loc β€” a string describing where the error occurred, like the little "we were here" sign πŸ“
  • cmd β€” the tracing command that caused the error, the actual culprit fr fr πŸ’€
  • errs β€” the array of loc-specific static error strings 🧚
  • type β€” the index into errs[], and that's what produces the specific static err string ✨
  • pos β€” the position the caret should be placed in the cmd 🎯

πŸ¦‹ DESCRIPTION πŸ¦‹

so it writes an error into tracing/error_log of the form:

<loc>: error: <text> Command: <cmd> ^

that caret at the end? that's the pos doing its little main character moment, pointing right at the problem πŸ’…

tracing/error_log is a small log file containing the last TRACING_LOG_ERRS_MAX errors (that's 8, bestie β€” eight whole errors, a whole little squad 🌈). Memory for errors isn't allocated unless there has been a tracing error β€” so it's lowkey chill and doesn't hog memory for no reason 🫢. and the error log can be cleared and have its memory freed by writing the empty string in truncation mode to it, i.e.:

echo > tracing/error_log

that's it, that's the cleanse πŸ§–β€β™€οΈβœ¨


πŸ’œ NOTE πŸ’œ

okay this part matters, listen up πŸ™ˆ β€” the errs array along with the type param are used to produce a static error string. this string is not copied and saved when the error is logged β€” only a pointer to it is saved πŸ‘€. so like, pointer vibes, not copy vibes. see existing callers for examples of how static strings are typically defined for use with tracing_log_err πŸŽ€


⭐ SEE ALSO ⭐

Kernel file ./kernel/trace/trace.c β€” and here's the whole crew, no one left behind πŸ’–:

trace_array_put(9), tracing_is_enabled(9), tracing_on(9), tracing_snapshot(9), tracing_alloc_snapshot(9), tracer_tracing_disable(9), tracer_tracing_enable(9), tracing_off(9), tracer_tracing_is_on(9), tracing_is_on(9), register_tracer(9), tracing_start(9), tracing_stop(9), trace_buffered_event_enable(9), trace_buffered_event_disable(9), trace_dump_stack(9), ignore_event(9), trace_adjust_address(9), tracing_update_buffers(9), trace_user_fault_destroy(9), trace_user_fault_init(9), trace_user_fault_get(9), trace_user_fault_put(9), trace_user_fault_read(9), err_pos(9), trace_array_get_by_name(9), tracing_init_dentry(9)


and that's the page!! πŸ’ this came from ./kernel/trace, dated October 2026, and the manual page itself is tracing_log_err(9) β€” okay love u, go log those errors responsibly πŸ«ΆπŸ’…βœ¨

πŸ“¦ where this page comes from