函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:trace_array_create

函数原型:static struct trace_array *trace_array_create(const char *name)

返回类型:struct trace_array

参数:

类型参数名称
const char *name
8473  ret等于负ENOMEM
8474  tr等于分配内存并置零
8475  如果非tr则返回:错误号
8478  name等于kstrdup(name, GFP_KERNEL)
8479  如果非name则转到:out_free_tr
8482  如果非分配CPU掩码则转到:out_free_tr
8485  trace_flags等于trace_flags按位与race_flags that are default zero for instances 的反
8487  pumask_copy - *dstp = *srcp*@dstp: the result*@srcp: the input cpumask
8489  raw_spin_lock_init( & start_lock)
8491  * max_lock is used to protect the swapping of buffers * when taking a max snapshot. The buffers themselves are * protected by per_cpu spinlocks. But the action of the swap * needs its own lock. * This is defined as a arch_spinlock_t in order to help * with = (arch_spinlock_t)
8493  current_trace等于nop_trace
8495  初始化链表头
8496  初始化链表头
8497  初始化链表头
8498  初始化链表头
8500  如果allocate_trace_buffers(tr, trace_buf_size)小于0则转到:out_free_tr
8503  dir等于tracefs_create_dir(name, trace_instance_dir)
8504  如果非dir则转到:out_free_tr
8507  ret等于vent_trace_add_tracer - add a instance of a trace_array to events*@parent: The parent dentry to place the files/directories for events in*@tr: The trace array associated with these events* When a new instance is created, it needs to set up its events
8508  如果ret
8509  tracefs_remove_recursive(dir)
8510  转到:out_free_tr
8513  ftrace_init_trace_array(tr)
8515  init_tracer_tracefs(tr, dir)
8516  init_trace_flags_index(tr)
8517  __update_tracer_options(tr)
8519  添加链表项
8521  ref自加
8524  返回:tr
8526  out_free_tr :
8527  free_trace_buffers(tr)
8528  释放CPU掩码
8529  kfree(name)
8530  kfree(tr)
8532  返回:错误号
调用者
名称描述
instance_mkdir
trace_array_get_by_namerace_array_get_by_name - Create/Lookup a trace array, given its name