Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\tracing_map.c Create Date:2022-07-28 12:07:46
Last Modify:2020-03-17 19:44:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sort_secondary

Proto:static void sort_secondary(struct tracing_map *map, const struct tracing_map_sort_entry **entries, unsigned int n_entries, struct tracing_map_sort_key *primary_key, struct tracing_map_sort_key *secondary_key)

Type:void

Parameter:

TypeParameterName
struct tracing_map *map
const struct tracing_map_sort_entry **entries
unsigned intn_entries
struct tracing_map_sort_key *primary_key
struct tracing_map_sort_key *secondary_key
992  int( * primary_fn)(const struct tracing_map_sort_entry * * , const struct tracing_map_sort_entry * * )
994  int( * secondary_fn)(const struct tracing_map_sort_entry * * , const struct tracing_map_sort_entry * * )
996  start = 0 , n_sub = 1
998  If is_key(map, field_idx) Then primary_fn = cmp_entries_key
1000  Else primary_fn = cmp_entries_sum
1003  If is_key(map, field_idx) Then secondary_fn = cmp_entries_key
1005  Else secondary_fn = cmp_entries_sum
1008  When i < n_entries - 1 cycle
1009  a = entries[i]
1010  b = entries[i + 1]
1012  If primary_fn(a, b) == 0 Then
1013  n_sub++
1014  If i < n_entries - 2 Then Continue
1018  If n_sub < 2 Then
1019  start = i + 1
1020  n_sub = 1
1021  Continue
1024  set_sort_key(map, secondary_key)
1025  sort( & entries[start], n_sub, size of * , (int( * )(constvoid * , constvoid * ))secondary_fn, NULL)
1028  set_sort_key(map, primary_key)
1030  start = i + 1
1031  n_sub = 1
Caller
NameDescribe
tracing_map_sort_entriesracing_map_sort_entries - Sort the current set of tracing_map_elts in a map*@map: The tracing_map*@sort_key: The sort key to use for sorting*@sort_entries: outval: pointer to allocated and sorted array of entries* tracing_map_sort_entries() sorts the