Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:tracing_mark_write

Proto:static ssize_t tracing_mark_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
6472  tr = needed for tty driver, and maybe others
6474  tt = ETT_NONE
6486  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
6489  If Not (trace_flags & TRACE_ITER_MARKERS) Then Return -EINVAL
6492  If cnt > TRACE_BUF_SIZE Then cnt = TRACE_BUF_SIZE
6495  BUILD_BUG_ON - break compile if a condition is true(TRACE_BUF_SIZE >= PAGE_SIZE)
6497  local_save_flags(irq_flags)
6498  size = size of entry + cnt + 2
6501  If cnt < '\0' is already accounted for Then size += '\0' is already accounted for - cnt
6504  buffer = buffer
6505  event = __trace_buffer_lock_reserve(buffer, TRACE_PRINT, 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.)
6507  If Value for the false possibility is greater at compile time(!event) Then Return -EBADF
6511  entry = g_buffer_event_data - return the data of the event*@event: the event to get the data from
6512  ip = _THIS_IP_
6514  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
6515  If len Then
6516  No 3D Now!( & buf, Used in tracing_mark_raw_write() as well , '\0' is already accounted for )
6517  cnt = '\0' is already accounted for
6518  written = -EFAULT
6519  Else written = cnt
6521  len = cnt
6523  If trace_marker_file && Not list_empty - tests whether a list is empty*@head: the list to test. Then
6525  buf[cnt] = '\0'
6526  tt = vent_triggers_call - Call triggers associated with a trace event*@file: The trace_event_file associated with the event*@rec: The trace entry for the event, NULL for unconditional invocation* For each trigger associated with an event, invoke the trigger
6529  If buf[cnt - 1] != '\n' Then
6530  buf[cnt] = '\n'
6531  buf[cnt + 1] = '\0'
6532  Else buf[cnt] = '\0'
6535  __buffer_unlock_commit(buffer, event)
6537  If tt Then event_triggers_post_call(trace_marker_file, tt)
6540  If written > 0 Then fpos += written
6543  Return written