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

Name:tracing_map_array_alloc

Proto:struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts, unsigned int entry_size)

Type:struct tracing_map_array

Parameter:

TypeParameterName
unsigned intn_elts
unsigned intentry_size
325  a = 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).
326  If Not a Then Return 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_elts / entries_per_page
332  If Not n_pages Then n_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 = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
338  If Not pages Then Go to free
341  When i < n_pages cycle
342  pages[i] = get_zeroed_page(GFP_KERNEL)
343  If Not pages[i] Then Go to free
346  out :
347  Return a
348  free :
349  tracing_map_array_free(a)
350  a = NULL
352  Go to out
Caller
NameDescribe
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