函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:NMI-safe method to read a local event, that is an event that* is:* - either for the current task, or for this CPU* - does not have inherit set, for inherited task events* will not be local and we cannot read them atomically* - must not have a pmu::count

函数原型:int perf_event_read_local(struct perf_event *event, u64 *value, u64 *enabled, u64 *running)

返回类型:int

参数:

类型参数名称
struct perf_event *event
u64 *value
u64 *enabled
u64 *running
4070  ret等于0
4076  local_irq_save(flags)
4082  如果inherit
4083  ret等于负EOPNOTSUPP
4084  转到:out
4088  如果attach_state按位与PERF_ATTACH_TASKtarget不等于当前进程
4090  ret等于负EINVAL
4091  转到:out
4095  如果非attach_state按位与PERF_ATTACH_TASK的值且cpu不等于当前cpu ID()则
4097  ret等于负EINVAL
4098  转到:out
4102  如果pinnedoncpu不等于当前cpu ID()则
4103  ret等于负EBUSY
4104  转到:out
4112  如果oncpu恒等于当前cpu ID()则read(event)
4115  value等于local64_read( & count)
4116  如果enabledrunning
4117  now等于shadow_ctx_timeperf_clock()
4120  __perf_update_times(event, now, & __enabled, & __running)
4121  如果enabledenabled等于__enabled
4123  如果runningrunning等于__running
4126  out :
4127  local_irq_restore(flags)
4129  返回:ret
调用者
名称描述
measure_residency_fn
____bpf_perf_prog_read_value
perf_event_fd_array_get_ptr