函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sort_secondary

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

返回类型:void

参数:

类型参数名称
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  如果is_key(map, field_idx)则primary_fn等于cmp_entries_key
1000  否则primary_fn等于cmp_entries_sum
1003  如果is_key(map, field_idx)则secondary_fn等于cmp_entries_key
1005  否则secondary_fn等于cmp_entries_sum
1008 i小于n_entries减1循环
1009  a等于entries[i]
1010  b等于entries[i + 1]
1012  如果primary_fn(a, b)恒等于0则
1013  n_sub自加
1014  如果i小于n_entries减2则继续下一循环
1018  如果n_sub小于2则
1019  start等于i加1
1020  n_sub等于1
1021  继续下一循环
1024  set_sort_key(map, secondary_key)
1025  sort( & entries[start], n_sub, *的长度, (int( * )(constvoid * , constvoid * ))secondary_fn, NULL)
1028  set_sort_key(map, primary_key)
1030  start等于i加1
1031  n_sub等于1
调用者
名称描述
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