tracing_map_add_var(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the tracing_map in 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:


πŸ’… 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