函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:perf_copy_attr

函数原型:static int perf_copy_attr(struct perf_event_attr __user *uattr, struct perf_event_attr *attr)

返回类型:int

参数:

类型参数名称
struct perf_event_attr __user *uattr
struct perf_event_attr *attr
10906  memset(attr, 0, attr的长度)
10908  ret等于Careful: we have to cast the result to the type of the pointer* for sign reasons(size, & Size of the attr structure, for fwd/bwd compat.)
10909  如果ret则返回:ret
10913  如果非sizesize等于sizeof first published struct
10915  如果size小于sizeof first published struct size大于PAGE_SIZE则转到:err_size
10918  ret等于py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space
10919  如果ret
10920  如果ret恒等于负E2BIG则转到:err_size
10922  返回:ret
10925  Size of the attr structure, for fwd/bwd compat.等于size
10927  如果__reserved_1__reserved_2__reserved_3则返回:负EINVAL
10930  如果sample_type按位与PERF_SAMPLE_MAX减1的差的反则返回:负EINVAL
10933  如果read_format按位与PERF_FORMAT_MAX减1的差的反则返回:负EINVAL
10936  如果sample_type按位与PERF_SAMPLE_BRANCH_STACK
10937  mask等于um perf_branch_sample_type
10940  如果mask按位与PERF_SAMPLE_BRANCH_MAX减1的差的反则返回:负EINVAL
10944  如果非mask按位与PERF_SAMPLE_BRANCH_PLM_ALL的反的值则返回:负EINVAL
10948  如果非mask按位与PERF_SAMPLE_BRANCH_PLM_ALL的值则
10951  如果非ditto kernel mask或等于PERF_SAMPLE_BRANCH_KERNEL
10954  如果非don't count user mask或等于PERF_SAMPLE_BRANCH_USER
10957  如果非ditto hypervisor mask或等于PERF_SAMPLE_BRANCH_HV
10966  ret等于perf_allow_kernel(attr)
10967  如果ret则返回:ret
10972  如果sample_type按位与PERF_SAMPLE_REGS_USER
10973  ret等于perf_reg_validate(Defines set of user regs to dump on samples.* See asm/perf_regs.h for details.)
10974  如果ret则返回:ret
10978  如果sample_type按位与PERF_SAMPLE_STACK_USER
10979  如果非arch_perf_have_user_stack_dump()则返回:负ENOSYS
10987  如果Defines size of the user stack to dump on samples.大于等于USHRT_MAX则返回:负EINVAL
10989  否则如果非IS_ALIGNED(Defines size of the user stack to dump on samples., sizeof(u64))则返回:负EINVAL
10993  如果非sample_max_stacksample_max_stack等于sysctl_perf_event_max_stack
10996  如果sample_type按位与PERF_SAMPLE_REGS_INTRret等于perf_reg_validate(Defines set of regs to dump for each sample* state captured on:* - precise = 0: PMU interrupt* - precise > 0: sampled instruction* See asm/perf_regs.h for details.)
10998  out :
10999  返回:ret
11001  err_size :
11002  put_user - Write a simple value into user space(attr的长度, & Size of the attr structure, for fwd/bwd compat.)
11003  ret等于负E2BIG
11004  转到:out
调用者
名称描述
_perf_ioctl