函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:ftrace_event_pid_write

函数原型:static ssize_t ftrace_event_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
1605  m等于 needed for tty driver, and maybe others
1606  tr等于private
1607  struct trace_pid_list * filtered_pids = NULL
1612  如果非cnt则返回: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  如果ret小于0则返回: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  如果ret小于0则转到: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  设置内存位
1634  如果filtered_pids
1635  tracepoint_synchronize_unregister()
1636  trace_free_pid_list(filtered_pids)
1637  否则如果pid_list
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  如果ret大于0则ppos加等于ret
1678  返回:ret