Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\gcov\gcc_4_7.c Create Date:2022-07-28 11:32:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:gcov_info_dup - duplicate profiling data set*@info: profiling data set to duplicate* Return newly allocated duplicate on success, %NULL on error.

Proto:struct gcov_info *gcov_info_dup(struct gcov_info *info)

Type:struct gcov_info

Parameter:

TypeParameterName
struct gcov_info *info
278  dup = kmemdup(info, size of dup , GFP_KERNEL)
279  If Not dup Then Return NULL
282  next = NULL
283  filename = NULL
284  functions = NULL
286  filename = kstrdup(filename, GFP_KERNEL)
287  If Not filename Then Go to err_free
290  functions = 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).
292  If Not functions Then Go to err_free
295  active = Determine number of active counters. Based on gcc magic.
296  fi_size = sizeof(structgcov_fn_info)
297  fi_size += sizeof(structgcov_ctr_info) * active
299  When fi_idx < n_functions cycle
300  functions[fi_idx] = 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).
301  If Not functions[fi_idx] Then Go to err_free
304  *functions[fi_idx] = *functions[fi_idx]
306  sci_ptr = ctrs
307  dci_ptr = ctrs
309  When ct_idx < active cycle
315  If Not values Then Go to err_free
318  num = num
321  sci_ptr++
322  dci_ptr++
326  Return dup
327  err_free :
328  gcov_info_free - release memory for profiling data set duplicate*@info: profiling data set duplicate to free
329  Return NULL