Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ftrace_event_pid_write

Proto:static ssize_t ftrace_event_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
1605  m = needed for tty driver, and maybe others
1606  tr = private
1607  struct trace_pid_list * filtered_pids = NULL
1612  If Not cnt Then Return 0
1615  ret = racing_update_buffers - used by tracing facility to expand ring buffers* To save on memory when the tracing is never used on a system with it* configured in
1616  If ret < 0 Then Return ret
1619  mutex_lock( & event_mutex)
1621  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(filtered_pids, lockdep_is_held( & event_mutex))
1624  ret = trace_pid_write(filtered_pids, & pid_list, ubuf, cnt)
1625  If ret < 0 Then Go to out
1628  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(filtered_pids, pid_list)
1631  Atomically set a bit in memory
1634  If filtered_pids Then
1635  tracepoint_synchronize_unregister()
1636  trace_free_pid_list(filtered_pids)
1637  Else if pid_list Then
1644  register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_pre, tr, INT_MAX)
1646  register_trace_prio_sched_switch(event_filter_pid_sched_switch_probe_post, tr, 0)
1649  register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_pre, tr, INT_MAX)
1651  register_trace_prio_sched_wakeup(event_filter_pid_sched_wakeup_probe_post, tr, 0)
1654  register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_pre, tr, INT_MAX)
1656  register_trace_prio_sched_wakeup_new(event_filter_pid_sched_wakeup_probe_post, tr, 0)
1659  register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_pre, tr, INT_MAX)
1661  register_trace_prio_sched_waking(event_filter_pid_sched_wakeup_probe_post, tr, 0)
1670  on_each_cpu(ignore_task_cpu, tr, 1)
1672  out :
1673  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.
1675  If ret > 0 Then ppos += ret
1678  Return ret