函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__tracing_open

函数原型:static struct trace_iterator *__tracing_open(struct inode *inode, struct file *file, bool snapshot)

返回类型:struct trace_iterator

参数:

类型参数名称
struct inode *inode
struct file *file
boolsnapshot
4162  tr等于s or device private pointer
4166  如果Kill all tracing for good (never come back).* It is initialized to 1 but will turn to zero if the initialization* of the tracer is successful. But that is the only place that sets* this back to zero.则返回:错误号
4169  iter等于__seq_open_private(file, & tracer_seq_ops, iter的长度)
4170  如果非iter则返回:错误号
4173  buffer_iter等于分配数组内存并置零
4175  如果非buffer_iter则转到:release
4182  mutex_lock( & race_types_lock is used to protect the trace_types list.)
4183  trace等于分配内存并置零
4184  如果非trace则转到:fail
4187  trace等于current_trace
4189  如果非zalloc_cpumask_var( & started, GFP_KERNEL)则转到:fail
4192  tr等于tr
4200  trace_buffer等于trace_buffer
4201  it's true when current open file is snapshot 等于snapshot
4202  pos等于负1
4203  cpu_file等于Should be used after trace_array_get(), trace_types_lock* ensures that i_cdev was already initialized.
4204  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & mutex)
4207  如果traceopenopen(iter)
4211  如果g_buffer_overruns - get the number of overruns in buffer*@buffer: The ring buffer* Returns the total number of overruns in the ring buffer* (all CPU entries)iter_flags或等于TRACE_FILE_ANNOTATE
4215  如果 is this clock in nanoseconds? iter_flags或等于TRACE_FILE_TIME_IN_NS
4219  如果非 it's true when current open file is snapshot tracing_stop_tr(tr)
4222  如果cpu_file恒等于RING_BUFFER_ALL_CPUS
4228  g_buffer_read_prepare_sync - Synchronize a set of prepare calls* All previously invoked ring_buffer_read_prepare calls to prepare* iterators will be synchronized. Afterwards, read_buffer_read_start* calls on those iterators are allowed.
4233  否则
4234  cpu等于cpu_file
4235  buffer_iter[cpu]等于g_buffer_read_prepare - Prepare for a non consuming read of the buffer*@buffer: The ring buffer to read from*@cpu: The cpu buffer to iterate over*@flags: gfp flags to use for memory allocation* This performs the initial preparations necessary to iterate
4238  g_buffer_read_prepare_sync - Synchronize a set of prepare calls* All previously invoked ring_buffer_read_prepare calls to prepare* iterators will be synchronized. Afterwards, read_buffer_read_start* calls on those iterators are allowed.
4239  g_buffer_read_start - start a non consuming read of the buffer*@iter: The iterator returned by ring_buffer_read_prepare* This finalizes the startup of an iteration through the buffer
4240  tracing_iter_reset(iter, cpu)
4243  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
4245  返回:iter
4247  fail :
4248  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
4249  kfree(trace)
4250  kfree(buffer_iter)
4251  release :
4252  seq_release_private(inode, file)
4253  返回:错误号
调用者
名称描述
tracing_open