tracing_map_add_sum_field(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« tracing_map_add_sum_field(9) πŸ’«

ok so this is a page straight out of the Kernel API Manual bestie, and we're talking about one tiny little function that does one tiny little job and honestly? it ate. let's get into it πŸŽ€


✨ NAME ✨

tracing_map_add_sum_field β€” bestie, this one adds a field that describes a tracing_map sum πŸ’…


🌸 SYNOPSIS 🌸

int tracing_map_add_sum_field (struct tracing_map *map );

like, that's it. that's the whole vibe. one arg, one int back πŸ¦‹


🫢 ARGUMENTS 🫢

  • map β€” the tracing_map in question, the main character of this whole situation πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

okay so picture this: you're adding a sum field to the key, and the function hands you back the index that identifies it β€” both in the map and in the associated tracing_map_elts. that index is the whole point, iykyk.

and what do you even do with that index? so glad you asked:

  • you use it, for instance, to update a sum for a particular tracing_map_elt using tracing_map_update_sum
  • or you can read it right back out via tracing_map_read_sum

that's the whole tea. no cap, that's literally it β˜•βœ¨


πŸ”₯ RETURN πŸ”₯

  • the index identifying the field in the map and the associated tracing_map_elts β€” slay πŸ’…
  • or -EINVAL on error 😭 (it happens to the best of us)

πŸ¦‹ SEE ALSO πŸ¦‹

kernel file ./kernel/trace/tracing_map.c plus the whole friend group:


ok that's the page!! huge shoutout to ./kernel/trace for being the source of this whole moment, to the Kernel API Manual for hosting, and to October 2026 for the timestamp β€” go forth and add your sum fields bestie, ily, bye!! πŸ’œπŸ§šβ­

πŸ“¦ where this page comes from