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:50
Last Modify:2020-03-17 19:44:05 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:racing_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

Proto: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)

Type:int

Parameter:

TypeParameterName
struct tracing_map *map
struct tracing_map_sort_key *sort_keys
unsigned intn_sort_keys
struct tracing_map_sort_entry ***sort_entries
1064  int( * cmp_entries_fn)(const struct tracing_map_sort_entry * * , const struct tracing_map_sort_entry * * )
1069  entries = vmalloc(array_size() - Calculate size of 2-dimensional array.*@a: dimension one*@b: dimension two* Calculates size of 2-dimensional array: @a *@b.* Returns: number of bytes needed to represent the array or SIZE_MAX on* overflow.)
1070  If Not entries Then Return -ENOMEM
1073  When i < map_size cycle
1076  entry = TRACING_MAP_ENTRY(map, i)
1078  If Not key || Not val Then Continue
1081  entries[n_entries] = create_sort_entry(key, val)
1083  If Not entries[n_entries++] Then
1084  ret = -ENOMEM
1085  Go to free
1089  If n_entries == 0 Then
1090  ret = 0
1091  Go to free
1094  If n_entries == 1 Then
1095  sort_entries = entries
1096  Return 1
1099  detect_dups(entries, n_entries, key_size)
1101  If is_key(map, field_idx) Then cmp_entries_fn = cmp_entries_key
1103  Else cmp_entries_fn = cmp_entries_sum
1106  set_sort_key(map, & sort_keys[0])
1108  sort(entries, n_entries, size of * , (int( * )(constvoid * , constvoid * ))cmp_entries_fn, NULL)
1111  If n_sort_keys > 1 Then sort_secondary(map, (conststructtracing_map_sort_entry * * )entries, n_entries, & sort_keys[0], & sort_keys[1])
1118  sort_entries = entries
1120  Return n_entries
1121  free :
1122  racing_map_destroy_sort_entries - Destroy an array of sort entries*@entries: The entries to destroy*@n_entries: The number of entries in the array* Destroy the elements returned by a tracing_map_sort_entries() call.
1124  Return ret
Caller
NameDescribe
print_entries