Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\fgraph.c Create Date:2022-07-28 12:17:49
Last Modify:2020-03-17 20:08:56 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Try to assign a return stack array on FTRACE_RETSTACK_ALLOC_SIZE tasks.

Proto:static int alloc_retstack_tasklist(struct ftrace_ret_stack **ret_stack_list)

Type:int

Parameter:

TypeParameterName
struct ftrace_ret_stack **ret_stack_list
373  ret = 0
374  start = 0 , end = FTRACE_RETSTACK_ALLOC_SIZE
377  When i < FTRACE_RETSTACK_ALLOC_SIZE cycle
378  ret_stack_list[i] = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
382  If Not ret_stack_list[i] Then
383  start = 0
384  end = i
385  ret = -ENOMEM
386  Go to free
390  read_lock( & tasklist_lock)
391  Careful: do_each_thread/while_each_thread is a double loop so* 'break' will not work as expected - use goto instead.(g, t)
392  If start == end Then
393  ret = -EAGAIN
394  Go to unlock
397  If (ret_stack == NULL) Then
399  atomic_set( & trace_overrun, 0)
400  curr_ret_stack = -1
401  curr_ret_depth = -1
403  smp_wmb()
408  unlock :
410  free :
411  When i < end cycle kfree(ret_stack_list[i])
413  Return ret
Caller
NameDescribe
start_graph_tracingAllocate a return stack for each task