tracing_map_sort_entries(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 tracing_map_sort_entries(9) 🌸

okay bestie, welcome to the Kernel API Manual β€” this one lives in tracing_map_sort_entries(9) and it's literally the glow-up pass for your tracing map entries. let's get into it πŸ’…


✨ NAME ✨

tracing_map_sort_entries β€” Sort the current set of tracing_map_elts in a map πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int tracing_map_sort_entries (struct tracing_map *map , struct
tracing_map_sort_key *sort_keys , unsigned int n_sort_keys , struct
tracing_map_sort_entry ***sort_entries );

πŸ’– ARGUMENTS πŸ’–

  • map β€” The tracing_map. the main character, obvs πŸ‘‘
  • sort_keys β€” The sort key to use for sorting πŸ”‘
  • n_sort_keys β€” hitcount, always have at least one. not me stressing this but fr, minimum one 🫢
  • sort_entries β€” outval: pointer to allocated and sorted array of entries ✨

🌈 DESCRIPTION 🌈

so tracing_map_sort_entries sorts the current set of entries in the map and hands the list of tracing_map_sort_entries containing them back to the client in the sort_entries param. the client can access the struct tracing_map_elt element of interest directly as the 'elt' field of a returned struct tracing_map_sort_entry object. it's giving convenient, honestly πŸ’…

the sort_key has only two fields: idx and descending. 'idx' refers to the index of the field added via tracing_map_add_sum_field or tracing_map_add_key_field when the tracing_map was initialized. by default is ascending. lowkey important, don't forget it πŸ™ˆ

bestie listen β€” the client should not hold on to the returned array. use it, then call tracing_map_destroy_sort_entries when done. it's a borrow, not a gift, iykyk 😭

⭐ RETURN ⭐

the number of sort_entries in the struct tracing_map_sort_entry array, negative on error. slay when positive, πŸ’€ when negative.


🌸 SEE ALSO 🌸

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


that's the whole page, bestie!! go sort those entries and remember to clean up after yourself πŸ§šπŸ’œ

from the ./kernel/trace girlies, dated October 2026 β€” mwah, ily, bye πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from