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

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

Proto:struct tracing_map *tracing_map_create(unsigned int map_bits, unsigned int key_size, const struct tracing_map_ops *ops, void *private_data)

Type:struct tracing_map

Parameter:

TypeParameterName
unsigned intmap_bits
unsigned intkey_size
const struct tracing_map_ops *ops
void *private_data
768  If map_bits < TRACING_MAP_BITS_MIN || map_bits > TRACING_MAP_BITS_MAX Then Return ERR_PTR( - EINVAL)
772  map = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
773  If Not map Then Return ERR_PTR( - ENOMEM)
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  If Not map Then Go to free
790  key_size = key_size
791  When i < TRACING_MAP_KEYS_MAX cycle key_idx[i] = -1
793  out :
794  Return 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 = ERR_PTR( - ENOMEM)
799  Go to out
Caller
NameDescribe
create_hist_data