函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Consumer reader.

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

返回类型:ssize_t

参数:

类型参数名称
struct file *filp
char __user *ubuf
size_tcnt
loff_t *ppos
6100  iter等于 needed for tty driver, and maybe others
6108  mutex_lock( & mutex)
6111  sret等于trace_seq_to_user( & The below is zeroed out in pipe_read , ubuf, cnt)
6112  如果sret不等于负EBUSY则转到:out
6115  trace_seq_init( & The below is zeroed out in pipe_read )
6117  如果read
6118  sret等于read(iter, filp, ubuf, cnt, ppos)
6119  如果sret则转到:out
6123  waitagain :
6124  sret等于Must be called with iter->mutex held.
6125  如果sret小于等于0则转到:out
6129  如果trace_empty(iter)则
6130  sret等于0
6131  转到:out
6134  如果cnt大于等于PAGE_SIZEcnt等于PAGE_SIZE减1
6138  memset( & The below is zeroed out in pipe_read , 0, sizeof(structtrace_iterator) - offsetof(structtrace_iterator, seq))
6141  清空全部CPU信息
6142  trace_seq_init( & The below is zeroed out in pipe_read )
6143  pos等于负1
6145  trace_event_read_lock()
6146  trace_access_lock(cpu_file)
6147  当(Find the next real entry, and increment the iterator to the next entry != NULL)循环
6149  save_len等于len
6151  ret等于Called with trace_event_read_lock() held.
6152  如果ret恒等于 Retry after flushing the seq
6154  len等于save_len
6155  退出
6157  如果ret不等于TRACE_TYPE_NO_CONSUMEtrace_consume(iter)
6160  如果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大于等于cnt退出
6168  WARN_ONCE(full, "full flag set for trace type %d", type)
6171  trace_access_unlock(cpu_file)
6172  trace_event_read_unlock()
6175  sret等于trace_seq_to_user( & The below is zeroed out in pipe_read , ubuf, cnt)
6176  如果readpos大于等于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 amounttrace_seq_init( & The below is zeroed out in pipe_read )
6183  如果sret恒等于负EBUSY则转到:waitagain
6186  out :
6187  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.
6189  返回:sret