Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ftrace_pid_write

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

Type:ssize_t

Parameter:

TypeParameterName
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  If Not cnt Then Return 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  If ret < 0 Then Go to 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  If filtered_pids Then
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  Else if pid_list Then
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  If ret > 0 Then ppos += ret
7162  Return ret