tracing_map_sort_entries(9)
πΈ 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β Thetracing_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:
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_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)
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
- 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