Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:tracing_splice_read_pipe

Proto:static ssize_t tracing_splice_read_pipe(struct file *filp, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags)

Type:ssize_t

Parameter:

TypeParameterName
struct file *filp
loff_t *ppos
struct pipe_inode_info *pipe
size_tlen
unsigned intflags
6260  iter = needed for tty driver, and maybe others
6261  struct splice_pipe_desc spd = {page map = pages_def, pages[] may not be contig = partial_def, umber of populated pages in map = 0, pages[] & partial[] arrays size = PIPE_DEF_BUFFERS, ps associated with output pipe = & tracing_pipe_buf_ops, spd_release = tracing_spd_release_pipe, }
6273  If r dynamic pipe sizing Then Return -ENOMEM
6276  mutex_lock( & mutex)
6278  If splice_read Then
6279  ret = splice_read(iter, filp, ppos, pipe, len, flags)
6281  If ret Then Go to out_err
6285  ret = Must be called with iter->mutex held.
6286  If ret <= 0 Then Go to out_err
6289  If Not ent && Not Find the next real entry, and increment the iterator to the next entry Then
6290  ret = -EFAULT
6291  Go to out_err
6294  trace_event_read_lock()
6295  trace_access_lock(cpu_file)
6298  When i < pages[] & partial[] arrays size && rem cycle
6299  page map [i] = alloc_page(GFP_KERNEL)
6300  If Not page map [i] Then Break
6303  rem = tracing_fill_pipe_page(rem, iter)
6306  ret = TODO add a seq_buf_to_buffer()
6309  If ret < 0 Then
6311  Break
6313  offset = 0
6314  len = race_seq_used - amount of actual data written to buffer*@s: trace sequence descriptor* Returns the amount of data written to the buffer.* IMPORTANT!* Use this instead of @s->seq.len if you need to pass the amount
6316  trace_seq_init( & The below is zeroed out in pipe_read )
6319  trace_access_unlock(cpu_file)
6320  trace_event_read_unlock()
6321  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.
6323  umber of populated pages in map = i
6325  If i Then ret = splice_to_pipe - fill passed data into a pipe*@pipe: pipe to fill*@spd: data to fill* Description:*@spd contains a map of pages and len/offset tuples, along with* the struct pipe_buf_operations associated with these pages. This
6327  Else ret = 0
6329  out :
6330  splice_shrink_spd( & spd)
6331  Return ret
6333  out_err :
6334  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.
6335  Go to out