函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\trace\bpf_trace.c Create Date:2022-07-27 13:48:04
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:perf_event_query_prog_array

函数原型:int perf_event_query_prog_array(struct perf_event *event, void __user *info)

返回类型:int

参数:

类型参数名称
struct perf_event *event
void __user *info
1392  __useruquery等于info
1393  struct perf_event_query_bpf query = {}
1398  如果非操作权限检查则返回:负EPERM
1400  如果type不等于PERF_TYPE_TRACEPOINT则返回:负EINVAL
1402  如果copy_from_user( & query, uquery, query的长度)则返回:负EFAULT
1405  ids_len等于The below ids array length
1406  如果ids_len大于BPF_TRACE_MAX_PROGS则返回:负E2BIG
1408  ids等于分配数组内存并置零
1409  如果非ids则返回:负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  如果copy_to_user( & Set by the kernel to indicate the number of* available programs, & prog_cnt, prog_cnt的长度)或copy_to_user(User provided buffer to store program ids, ids, ids_len * sizeof(u32))则ret等于负EFAULT
1427  kfree(ids)
1428  返回:ret
调用者
名称描述
_perf_ioctl