Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:tracing_mark_raw_write

Proto:static ssize_t tracing_mark_raw_write(struct file *filp, const char __user *ubuf, size_t cnt, loff_t *fpos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *filp
const char __user *ubuf
size_tcnt
loff_t *fpos
6553  tr = needed for tty driver, and maybe others
6564  If Kill all tracing for good (never come back).* It is initialized to 1 but will turn to zero if the initialization* of the tracer is successful. But that is the only place that sets* this back to zero. Then Return -EINVAL
6567  If Not (trace_flags & TRACE_ITER_MARKERS) Then Return -EINVAL
6571  If cnt < sizeof(unsignedint) || cnt > Limit it for now to 3K (including tag) Then Return -EINVAL
6574  If cnt > TRACE_BUF_SIZE Then cnt = TRACE_BUF_SIZE
6577  BUILD_BUG_ON - break compile if a condition is true(TRACE_BUF_SIZE >= PAGE_SIZE)
6579  local_save_flags(irq_flags)
6580  size = size of entry + cnt
6581  If cnt < FAULT_SIZE_ID Then size += FAULT_SIZE_ID - cnt
6584  buffer = buffer
6585  event = __trace_buffer_lock_reserve(buffer, TRACE_RAW_DATA, size, irq_flags, We mask the PREEMPT_NEED_RESCHED bit so as not to confuse all current users* that think a non-zero value indicates we cannot preempt.)
6587  If Not event Then Return -EBADF
6591  entry = g_buffer_event_data - return the data of the event*@event: the event to get the data from
6593  len = Architectures should provide two primitives (raw_copy_{to,from}_user())* and get rid of their private instances of copy_{to,from}_user() and* __copy_{to,from}_user{,_inatomic}().* raw_copy_{to,from}_user(to, from, size) should copy up to size bytes and
6594  If len Then
6595  id = -1
6596  No 3D Now!( & buf, Used in tracing_mark_raw_write() as well , '\0' is already accounted for )
6597  written = -EFAULT
6598  Else written = cnt
6601  __buffer_unlock_commit(buffer, event)
6603  If written > 0 Then fpos += written
6606  Return written