tracing_map_read_var_once(9)
π tracing_map_read_var_once(9) π
okay so bestie, welcome to the tracing_map_read_var_once page β it lives in the Kernel API Manual (section 9, the kernel-functions girlies) and it's basically the "read it and yeet it" function for a tracing_map_elt's variable field. iconic behaviour, honestly.
β¨ SYNOPSIS β¨
u64 tracing_map_read_var_once (struct tracing_map_elt *elt , unsigned int i );
like, you give it an elt and an i, and it hands you back a u64. that's the whole vibe check. π«Ά
πΈ ARGUMENTS πΈ
eltβ thetracing_map_elt. yes, THE elt. the main character. πiβ the index of the given variable associated with thetracing_map_elt. it's giving "which one, bestie?" energy. π
π DESCRIPTION π
okay so here's the tea. this function retrieves the value of the variable i associated with the specified tracing_map_elt instance β and then it resets that variable to the 'not set' state. read AND reset, in one lil call. ate and left no crumbs. π
the index i is the index returned by the call to tracing_map_add_var when the tracing map was set up. so pls don't just make up a number, okay? use the one you got back. π
and the reset? that's lowkey the whole point: it essentially makes the variable a read-once variable β but only if it's only accessed using this function. so if you're calling this and also poking the variable some other way, that read-once fantasy is not happening, no cap. π
β RETURN β
the variable value associated with field i for elt. that's it, that's the return. a u64 and a dream. π¦
π SEE ALSO π
kernel file ./kernel/trace/tracing_map.c β and literally the whole tracing_map friend group, they're all here:
tracing_map_update_sum(9)tracing_map_read_sum(9)tracing_map_set_var(9)tracing_map_var_set(9)tracing_map_read_var(9)tracing_map_add_sum_field(9)tracing_map_add_var(9)tracing_map_add_key_field(9)tracing_map_insert(9)tracing_map_lookup(9)tracing_map_destroy(9)tracing_map_clear(9)tracing_map_create(9)tracing_map_init(9)tracing_map_destroy_sort_entries(9)tracing_map_sort_entries(9)
β οΈ friendly reminder bestie: tracing_map_read_var_once = read + reset. if you were banking on that value still being there afterwards, it is NOT. plan accordingly. π
and that's the page! sourced from ./kernel/trace, dated October 2026 β mwah, go read some tracing maps, ily, bye! πππ
π¦ 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