函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:perf_event_read

函数原型:static int perf_event_read(struct perf_event *event, bool group)

返回类型:int

参数:

类型参数名称
struct perf_event *event
boolgroup
4134  state等于READ_ONCE(state)
4135  ret等于0
4141  again :
4142  如果state恒等于PERF_EVENT_STATE_ACTIVE
4151  smp_rmb()
4153  event_cpu等于READ_ONCE(oncpu)
4154  如果event_cpu大于等于CPU数量则返回:0
4157  data = (struct perf_read_data){event = event, group = group, ret = 0, }
4163  禁止抢占()
4164  event_cpu等于__perf_event_read_cpu(event, event_cpu)
4176  smp_call_function_single(event_cpu, Cross CPU call to read the hardware event, & data, 1)
4177  禁用抢占和中断()
4178  ret等于ret
4180  否则如果state恒等于PERF_EVENT_STATE_INACTIVE
4181  ctx等于ctx
4184  raw_spin_lock_irqsave( & Protect the states of the events in the list,* nr_active, and the list:, flags)
4185  state等于state
4186  如果state不等于PERF_EVENT_STATE_INACTIVE
4188  转到:again
4195  如果is_active按位与EVENT_TIME
4200  perf_event_update_time(event)
4201  如果groupperf_event_update_sibling_time(event)
4203  raw_spin_unlock_irqrestore( & Protect the states of the events in the list,* nr_active, and the list:, flags)
4206  返回:ret
调用者
名称描述
__perf_event_read_value
__perf_read_group_add
_perf_event_reset