Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Consumer reader.

Proto:static ssize_t tracing_read_pipe(struct file *filp, char __user *ubuf, size_t cnt, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
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  If sret != -EBUSY Then Go to out
6115  trace_seq_init( & The below is zeroed out in pipe_read )
6117  If read Then
6118  sret = read(iter, filp, ubuf, cnt, ppos)
6119  If sret Then Go to out
6123  waitagain :
6124  sret = Must be called with iter->mutex held.
6125  If sret <= 0 Then Go to out
6129  If trace_empty(iter) Then
6130  sret = 0
6131  Go to out
6134  If cnt >= PAGE_SIZE Then cnt = PAGE_SIZE - 1
6138  memset( & The below is zeroed out in pipe_read , 0, sizeof(structtrace_iterator) - offsetof(structtrace_iterator, seq))
6141  pumask_clear - clear all cpus (< nr_cpu_ids) in a cpumask*@dstp: the cpumask pointer
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  When (Find the next real entry, and increment the iterator to the next entry != NULL) cycle
6149  save_len = len
6151  ret = Called with trace_event_read_lock() held.
6154  len = save_len
6155  Break
6157  If ret != TRACE_TYPE_NO_CONSUME Then trace_consume(iter)
6160  If 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 Then Break
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  If 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 amount Then trace_seq_init( & The below is zeroed out in pipe_read )
6183  If sret == -EBUSY Then Go to 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  Return sret