Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:tracing_open_pipe

Proto:static int tracing_open_pipe(struct inode *inode, struct file *filp)

Type:int

Parameter:

TypeParameterName
struct inode *inode
struct file *filp
5947  tr = s or device private pointer
5951  ret = tracing_check_open_get_tr(tr)
5952  If ret Then Return ret
5955  mutex_lock( & race_types_lock is used to protect the trace_types list.)
5958  iter = 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).
5959  If Not iter Then
5960  ret = -ENOMEM
5961  __trace_array_put(tr)
5962  Go to out
5965  trace_seq_init( & The below is zeroed out in pipe_read )
5966  trace = current_trace
5968  If Not alloc_cpumask_var( & started, GFP_KERNEL) Then
5969  ret = -ENOMEM
5970  Go to fail
5974  pumask_setall - set all cpus (< nr_cpu_ids) in a cpumask*@dstp: the cpumask pointer
5976  If trace_flags & TRACE_ITER_LATENCY_FMT Then iter_flags |= TRACE_FILE_LAT_FMT
5980  If is this clock in nanoseconds? Then iter_flags |= TRACE_FILE_TIME_IN_NS
5983  tr = tr
5984  trace_buffer = trace_buffer
5985  cpu_file = Should be used after trace_array_get(), trace_types_lock* ensures that i_cdev was already initialized.
5986  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)
5987  needed for tty driver, and maybe others = iter
5989  If pipe_open Then pipe_open(iter)
5992  nonseekable_open(inode, filp)
5994  ref++
5995  out :
5996  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.
5997  Return ret
5999  fail :
6000  kfree(iter)
6001  __trace_array_put(tr)
6002  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.
6003  Return ret