函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tracing_map_array_alloc

函数原型:struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts, unsigned int entry_size)

返回类型:struct tracing_map_array

参数:

类型参数名称
unsigned intn_elts
unsigned intentry_size
325  a等于分配内存并置零
326  如果非a则返回:NULL
329  entry_size_shift等于ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last
330  entries_per_page等于PAGE_SIZE除1左移entry_size_shift位的值
331  n_pages等于n_eltsentries_per_page
332  如果非n_pagesn_pages等于1
334  entry_shift等于ls - find last set bit in word*@x: the word to search* This is defined in a similar way as the libc and compiler builtin* ffs, but returns the position of the most significant set bit.* fls(value) returns 0 if value is 0 or the position of the last减1
335  entry_mask等于1左移entry_shift位的值减1
337  pages等于分配数组内存并置零
338  如果非pages则转到:free
341 i小于n_pages循环
342  pages[i]等于get_zeroed_page(GFP_KERNEL)
343  如果非pages[i]则转到:free
346  out :
347  返回:a
348  free :
349  tracing_map_array_free(a)
350  a = NULL
352  转到:out
调用者
名称描述
tracing_map_alloc_elts
tracing_map_createracing_map_create - Create a lock-free map and element pool*@map_bits: The size of the map (2 ** map_bits)*@key_size: The size of the key for the map in bytes*@ops: Optional client-defined tracing_map_ops instance*@private_data: Client data associated