Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\bpf_trace.c Create Date:2022-07-28 12:37:43
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:perf_event_query_prog_array

Proto:int perf_event_query_prog_array(struct perf_event *event, void __user *info)

Type:int

Parameter:

TypeParameterName
struct perf_event *event
void __user *info
1392  __user * uquery = info
1393  struct perf_event_query_bpf query = {}
1398  If Not Check operation authority Then Return -EPERM
1400  If type != PERF_TYPE_TRACEPOINT Then Return -EINVAL
1402  If copy_from_user( & query, uquery, size of query ) Then Return -EFAULT
1405  ids_len = The below ids array length
1406  If ids_len > BPF_TRACE_MAX_PROGS Then Return -E2BIG
1408  ids = kcalloc - allocate memory for an array. The memory is set to zero.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc).
1409  If Not ids Then Return -ENOMEM
1418  mutex_lock( & bpf_event_mutex)
1419  progs = bpf_event_rcu_dereference(prog_array)
1420  ret = bpf_prog_array_copy_info(progs, ids, ids_len, & prog_cnt)
1421  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.
1423  If copy_to_user( & Set by the kernel to indicate the number of* available programs, & prog_cnt, size of prog_cnt ) || copy_to_user(User provided buffer to store program ids, ids, ids_len * sizeof(u32)) Then ret = -EFAULT
1427  kfree(ids)
1428  Return ret
Caller
NameDescribe
_perf_ioctl