函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

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

函数原型:struct tracing_map *tracing_map_create(unsigned int map_bits, unsigned int key_size, const struct tracing_map_ops *ops, void *private_data)

返回类型:struct tracing_map

参数:

类型参数名称
unsigned intmap_bits
unsigned intkey_size
const struct tracing_map_ops *ops
void *private_data
768  如果map_bits小于TRACING_MAP_BITS_MINmap_bits大于TRACING_MAP_BITS_MAX则返回:错误号
772  map等于分配内存并置零
773  如果非map则返回:错误号
776  map_bits等于map_bits
777  max_elts等于1左移map_bits
778  atomic_set( & next_elt, - 1)
780  map_size等于1左移map_bits加1位
781  ops等于ops
783  private_data等于private_data
785  map等于tracing_map_array_alloc(map_size, sizeof(structtracing_map_entry))
787  如果非map则转到:free
790  key_size等于key_size
791 i小于TRACING_MAP_KEYS_MAX循环key_idx[i]等于负1
793  out :
794  返回:map
795  free :
796  racing_map_destroy - Destroy a tracing_map*@map: The tracing_map to destroy* Frees a tracing_map along with its associated array of* tracing_map_elts.* Callers should make sure there are no readers or writers actively
797  map等于错误号
799  转到:out
调用者
名称描述
create_hist_data