tracing_map_add_var(9)
β¨ tracing_map_add_var β Kernel API Manual (section 9) β¨
okay bestie, so this is the tracing_map_add_var page from the Kernel API Manual, and it's honestly one of the shorter ones so we can absolutely get through it together. It's a kernel function, it lives in ./kernel/trace, and it's about adding a var to a tracing_map. Let's go π«Ά
πΈ NAME πΈ
tracing_map_add_var β the one that adds a field describing a tracing_map var π«
π SYNOPSIS π
int tracing_map_add_var (struct tracing_map *map );
π¦ ARGUMENTS π¦
mapβ thetracing_mapin question. literally just the map, she's the main character here π
π DESCRIPTION π
So what this does is: it adds a var to the map, and then it returns the index that identifies that var in the map and in the associated tracing_map_elts. That index is not just a little souvenir β you actually need it. It's the index you use, for instance, to update a var for one particular tracing_map_elt via tracing_map_update_var, or to read that var back via tracing_map_read_var. iykyk π₯
β RETURN β
The index identifying the var in the map and its associated tracing_map_elts β or -EINVAL on error π
no cap: if it hands you back -EINVAL, that's the error path, not a real index. don't go indexing anything with it bestie π
π SEE ALSO π
Kernel file ./kernel/trace/tracing_map.c β and honestly the whole tracing_map friend group shows up 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_read_var_once(9)tracing_map_add_sum_field(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)
π
and that's the whole page, bestie. sign-off time: this one's from the ./kernel/trace corner of the world, Kernel API Manual edition, dated October 2026 β go forth and index your vars 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