Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\events\core.c Create Date:2022-07-28 13:34:18
Last Modify:2022-05-20 07:50:19 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:perf_event_read

Proto:static int perf_event_read(struct perf_event *event, bool group)

Type:int

Parameter:

TypeParameterName
struct perf_event *event
boolgroup
4134  state = READ_ONCE(state)
4135  ret = 0
4141  again :
4142  If state == PERF_EVENT_STATE_ACTIVE Then
4151  smp_rmb()
4153  event_cpu = READ_ONCE(oncpu)
4154  If event_cpu >= Setup number of possible processor ids Then Return 0
4157  data = (struct perf_read_data){event = event, group = group, ret = 0, }
4163  Even if we don't have any preemption, we need preempt disable/enable* to be barriers, so that we don't have things like get_user/put_user* that can cause faults and scheduling migrate into our preempt-protected* region.()
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  preempt_enable()
4178  ret = ret
4180  Else if state == PERF_EVENT_STATE_INACTIVE Then
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  If state != PERF_EVENT_STATE_INACTIVE Then
4188  Go to again
4195  If is_active & EVENT_TIME Then
4200  perf_event_update_time(event)
4201  If group Then perf_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  Return ret
Caller
NameDescribe
__perf_event_read_value
__perf_read_group_add
_perf_event_reset