函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-27 14:54:57
Last Modify:2022-05-20 07:50:19 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:_perf_ioctl

函数原型:static long _perf_ioctl(struct perf_event *event, unsigned int cmd, unsigned long arg)

返回类型:long

参数:

类型参数名称
struct perf_event *event
unsigned intcmd
unsigned longarg
5241  flags等于arg
5244  :cmd恒等于Ioctls that can be done on a perf event fd:
5245  func等于Enable an event
5246  退出
5247  :cmd恒等于PERF_EVENT_IOC_DISABLE
5248  func等于Disable an event
5249  退出
5250  :cmd恒等于PERF_EVENT_IOC_RESET
5251  func等于_perf_event_reset
5252  退出
5254  :cmd恒等于PERF_EVENT_IOC_REFRESH
5255  返回:_perf_event_refresh(event, arg)
5257  :cmd恒等于PERF_EVENT_IOC_PERIOD
5261  如果copy_from_user( & value, (u64__user * )arg, value的长度)则返回:负EFAULT
5264  返回:_perf_event_period(event, value)
5266  :cmd恒等于PERF_EVENT_IOC_ID
5268  id等于If we inherit events we want to return the parent event id* to userspace.
5270  如果copy_to_user((void__user * )arg, & id, id的长度)则返回:负EFAULT
5272  返回:0
5275  :cmd恒等于PERF_EVENT_IOC_SET_OUTPUT
5278  如果arg不等于负1则
5281  ret等于perf_fget_light(arg, & output)
5282  如果ret则返回:ret
5286  fdput(output)
5287  否则
5288  ret等于perf_event_set_output(event, NULL)
5290  返回:ret
5293  :cmd恒等于PERF_EVENT_IOC_SET_FILTER
5294  返回:perf_event_set_filter(event, (void__user * )arg)
5296  :cmd恒等于PERF_EVENT_IOC_SET_BPF
5297  返回:perf_event_set_bpf_prog(event, arg)
5299  :cmd恒等于PERF_EVENT_IOC_PAUSE_OUTPUT
5302  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
5303  rb等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(rb)
5304  如果非rb或非 nr of data pages
5306  返回:负EINVAL
5308  rb_toggle_paused(rb, !!arg)
5309  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
5310  返回:0
5313  :cmd恒等于PERF_EVENT_IOC_QUERY_BPF
5314  返回:perf_event_query_prog_array(event, (void__user * )arg)
5316  :cmd恒等于PERF_EVENT_IOC_MODIFY_ATTRIBUTES
5318  err等于perf_copy_attr((structperf_event_attr__user * )arg, & new_attr)
5321  如果err则返回:err
5324  返回:perf_event_modify_attr(event, & new_attr)
5326  默认
5327  返回:负ENOTTY
5330  如果flags按位与PERF_IOC_FLAG_GROUPperf_event_for_each(event, func)
5332  否则Holding the top-level event's child_mutex means that any* descendant process that has inherited this event will block* in perf_event_exit_event() if it goes to exit, thus satisfying the* task existence requirements of perf_event_enable/disable.
5335  返回:0
调用者
名称描述
perf_ioctl