函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:tracing_mark_write

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

返回类型:ssize_t

参数:

类型参数名称
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  如果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.则返回:负EINVAL
6489  如果非trace_flags按位与TRACE_ITER_MARKERS的值则返回:负EINVAL
6492  如果cnt大于TRACE_BUF_SIZEcnt等于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等于entry的长度加cnt加2
6501  如果cnt小于'\0' is already accounted for size加等于'\0' is already accounted for cnt
6504  buffer等于buffer
6505  event等于__trace_buffer_lock_reserve(buffer, TRACE_PRINT, size, irq_flags, 抢占计数值)
6507  如果此条件成立可能性小(为编译器优化)(!event)则返回:负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  如果len
6516  内存复制( & 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  否则written等于cnt
6521  len等于cnt
6523  如果trace_marker_file且非链表为空
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  如果buf[cnt - 1]不等于'\n'则
6530  buf[cnt]等于'\n'
6531  buf[cnt + 1]等于'\0'
6532  否则buf[cnt]等于'\0'
6535  __buffer_unlock_commit(buffer, event)
6537  如果ttevent_triggers_post_call(trace_marker_file, tt)
6540  如果written大于0则fpos加等于written
6543  返回:written