函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tracing_buffers_read

函数原型:static ssize_t tracing_buffers_read(struct file *filp, char __user *ubuf, size_t count, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *filp
char __user *ubuf
size_tcount
loff_t *ppos
7346  info等于 needed for tty driver, and maybe others
7347  iter等于iter
7348  ret等于0
7351  如果非count则返回:0
7359  如果非spare
7360  spare等于g_buffer_alloc_read_page - allocate a page to read from buffer*@buffer: the buffer to allocate for
7362  如果是错误
7363  ret等于错误
7364  spare = NULL
7365  否则
7366  spare_cpu等于cpu_file
7369  如果非spare则返回:ret
7373  如果read小于PAGE_SIZE则转到:read
7376  again :
7377  trace_access_lock(cpu_file)
7378  ret等于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
7382  trace_access_unlock(cpu_file)
7384  如果ret小于0则
7385  如果trace_empty(iter)则
7386  如果f_flags按位与O_NONBLOCK则返回:负EAGAIN
7389  ret等于wait_on_pipe(iter, 0)
7390  如果ret则返回:ret
7393  转到:again
7395  返回:0
7398  read等于0
7399  read :
7400  size等于PAGE_SIZEread
7401  如果size大于countsize等于count
7404  ret等于copy_to_user(ubuf, spare + read, size)
7405  如果ret恒等于size则返回:负EFAULT
7408  size减等于ret
7410  ppos加等于size
7411  read加等于size
7413  返回:size