trace_array_get_by_name(9)
πΈ trace_array_get_by_name β the kernel API manual page, bestie edition πΈ
Okay so this is trace_array_get_by_name(9) from the Kernel API Manual, and ngl it's one of those little functions that's lowkey doing a LOT behind the scenes π
stay with me.
β¨ NAME β¨
trace_array_get_by_name β create or look up a trace array, given its name. That's it, that's the whole vibe π
π¦ SYNOPSIS π¦
struct trace_array * trace_array_get_by_name (const char *name , const
char *systems );
π ARGUMENTS π
nameβ the name of the trace array you wanna look up or create. Like the handle, the ID, the name-tag of trace arrays π·οΈsystemsβ a list of systems to create event directories for. PassNULLand you get all of them, no thoughts head empty, everything, the whole buffet π
π DESCRIPTION π
So it returns a pointer to the trace array with the given name. And if it can't be created? You get NULL. That's it. That's the whole deal. π
π NOTE π
Okay bestie this part is important, do NOT skip it π
This function increments the reference counter associated with the trace array it returns. Which is literally what makes sure it can't be freed while it's in use. Iconic, protective, main character energy. β¨
Use trace_array_put once the trace array is no longer needed. Periodt.
If the trace_array is going to be freed, trace_array_destroy needs to be called after the trace_array_put, or you can simply let user space delete it from the tracefs instances directory.
But β and this is the key part β until the trace_array_put is called, user space can not delete it. Like, physically cannot. It's locked in. π
π₯ SEE ALSO π₯
Kernel file ./kernel/trace/trace.c and honestly a whole friend group of functions: 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), tracing_log_err(9), tracing_init_dentry(9)
π§ And that's the page!! It lives in ./kernel/trace, it's dated October 2026, and it comes to you straight from the Kernel API Manual. Go forth and trace_array_put responsibly, bestie π«Άπ
π¦ 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