函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\tracing_map.c Create Date:2022-07-27 13:14:28
Last Modify:2020-03-17 19:44:05 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型: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)

返回类型:int

参数:

类型参数名称
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  如果非entries则返回:负ENOMEM
1073 i小于map_size循环
1076  entry等于TRACING_MAP_ENTRY(map, i)
1078  如果非key或非val则继续下一循环
1081  entries[n_entries]等于create_sort_entry(key, val)
1083  如果非entries[n_entries++]则
1084  ret等于负ENOMEM
1085  转到:free
1089  如果n_entries恒等于0则
1090  ret等于0
1091  转到:free
1094  如果n_entries恒等于1则
1095  sort_entries等于entries
1096  返回:1
1099  detect_dups(entries, n_entries, key_size)
1101  如果is_key(map, field_idx)则cmp_entries_fn等于cmp_entries_key
1103  否则cmp_entries_fn等于cmp_entries_sum
1106  set_sort_key(map, & sort_keys[0])
1108  sort(entries, n_entries, *的长度, (int( * )(constvoid * , constvoid * ))cmp_entries_fn, NULL)
1111  如果n_sort_keys大于1则sort_secondary(map, (conststructtracing_map_sort_entry * * )entries, n_entries, & sort_keys[0], & sort_keys[1])
1118  sort_entries等于entries
1120  返回: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  返回:ret
调用者
名称描述
print_entries