tracing_log_err(9)
π 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 takesNULLfor 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 ofloc-specific static error strings π§typeβ the index intoerrs[], and that's what produces the specific staticerrstring β¨posβ the position the caret should be placed in thecmdπ―
π¦ 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
- 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