Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:perf_read_group

Proto:static int perf_read_group(struct perf_event *event, u64 read_format, char __user *buf)

Type:int

Parameter:

TypeParameterName
struct perf_event *event
u64read_format
char __user *buf
4931  leader = group_leader
4932  ctx = ctx
4936  lockdep_assert_held( & Protect the list of events. Locking either mutex or lock* is sufficient to ensure the list doesn't change; to change* the list you need to lock both the mutex and the spinlock.)
4938  values = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
4939  If Not values Then Return -ENOMEM
4942  values[0] = 1 + nr_siblings
4948  mutex_lock( & child_mutex)
4950  ret = __perf_read_group_add(leader, read_format, values)
4951  If ret Then Go to unlock
4955  ret = __perf_read_group_add(child, read_format, values)
4956  If ret Then Go to unlock
4960  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.
4962  ret = read_size
4963  If copy_to_user(buf, values, read_size) Then ret = -EFAULT
4965  Go to out
4967  unlock :
4968  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.
4969  out :
4970  kfree(values)
4971  Return ret
Caller
NameDescribe
__perf_readRead the performance event - simple non blocking version for now