函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tracing_buffers_splice_read

函数原型:static ssize_t tracing_buffers_splice_read(struct file *file, loff_t *ppos, struct pipe_inode_info *pipe, size_t len, unsigned int flags)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
loff_t *ppos
struct pipe_inode_info *pipe
size_tlen
unsigned intflags
7499  info等于 needed for tty driver, and maybe others
7500  iter等于iter
7503  struct splice_pipe_desc spd = {page map = pages_def, pages[] may not be contig = partial_def, pages[] & partial[] arrays size = PIPE_DEF_BUFFERS, ps associated with output pipe = & Pipe buffer operations for a buffer. , spd_release = Callback from splice_to_pipe(), if we need to release some pages* at the end of the spd in case we error'ed out in filling the pipe., }
7512  ret等于0
7519  如果ppos按位与PAGE_SIZE减1则返回:负EINVAL
7522  如果len按位与PAGE_SIZE减1则
7523  如果len小于PAGE_SIZE则返回:负EINVAL
7525  len与等于PAGE_MASK
7528  如果r dynamic pipe sizing则返回:负ENOMEM
7531  again :
7532  trace_access_lock(cpu_file)
7533  entries等于g_buffer_entries_cpu - get the number of entries in a cpu buffer*@buffer: The ring buffer*@cpu: The per CPU buffer to get the entries from.
7535 i小于pages[] & partial[] arrays size lenentries循环
7539  ref等于分配内存并置零
7540  如果非ref
7541  ret等于负ENOMEM
7542  退出
7545  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
7546  buffer等于buffer
7547  page等于g_buffer_alloc_read_page - allocate a page to read from buffer*@buffer: the buffer to allocate for
7548  如果是错误
7549  ret等于错误
7550  page = NULL
7551  kfree(ref)
7552  退出
7554  cpu等于cpu_file
7556  r等于g_buffer_read_page - extract a page from the ring buffer*@buffer: buffer to extract from*@data_page: the page to use allocated from ring_buffer_alloc_read_page*@len: amount to extract*@cpu: the cpu of the buffer to extract
7558  如果r小于0则
7561  kfree(ref)
7562  退出
7565  page等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(page)
7567  page map [i]等于page
7568  len等于PAGE_SIZE
7569  offset等于0
7570  private等于ref
7571  umber of populated pages in map 自加
7572  ppos加等于PAGE_SIZE
7574  entries等于g_buffer_entries_cpu - get the number of entries in a cpu buffer*@buffer: The ring buffer*@cpu: The per CPU buffer to get the entries from.
7577  trace_access_unlock(cpu_file)
7578  umber of populated pages in map 等于i
7581  如果非umber of populated pages in map
7582  如果ret则转到:out
7585  ret等于负EAGAIN
7586  如果f_flags按位与O_NONBLOCKflags按位与don't block on the pipe splicing (but 则转到:out
7589  ret等于wait_on_pipe(iter, buffer_percent)
7590  如果ret则转到:out
7593  转到:again
7596  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
7597  out :
7598  splice_shrink_spd( & spd)
7600  返回:ret