函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ftrace_pid_write

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

返回类型:ssize_t

参数:

类型参数名称
struct file *filp
const char __user *ubuf
size_tcnt
loff_t *ppos
7119  m等于 needed for tty driver, and maybe others
7120  tr等于private
7121  struct trace_pid_list * filtered_pids = NULL
7125  如果非cnt则返回:0
7128  mutex_lock( & ftrace_lock)
7130  filtered_pids等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit(function_pids, lockdep_is_held( & ftrace_lock))
7133  ret等于trace_pid_write(filtered_pids, & pid_list, ubuf, cnt)
7134  如果ret小于0则转到:out
7137  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(function_pids, pid_list)
7139  如果filtered_pids
7140  Wait for a grace period to elapse. But it is illegal to invoke* synchronize_rcu() from within an RCU read-side critical section.* Therefore, any legal call to synchronize_rcu() is a quiescent
7141  trace_free_pid_list(filtered_pids)
7142  否则如果pid_list
7144  Tracepoint for task switches, performed by the scheduler:
7152  on_each_cpu(ignore_task_cpu, tr, 1)
7154  ftrace_update_pid_func()
7155  ftrace_startup_all(0)
7156  out :
7157  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.
7159  如果ret大于0则ppos加等于ret
7162  返回:ret