Function report |
Source Code:kernel\events\core.c |
Create Date:2022-07-28 13:40:53 |
| Last Modify:2022-05-20 07:50:19 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:perf_copy_attr
Proto:static int perf_copy_attr(struct perf_event_attr __user *uattr, struct perf_event_attr *attr)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct perf_event_attr __user * | uattr | |
| struct perf_event_attr * | attr |
| 10908 | ret = Get a simple variable from user space(size, & Size of the attr structure, for fwd/bwd compat.) |
| 10913 | If Not size Then size = sizeof first published struct |
| 10915 | If size < sizeof first published struct || size > PAGE_SIZE Then Go to err_size |
| 10918 | ret = py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space |
| 10919 | If ret Then |
| 10927 | If __reserved_1 || __reserved_2 || __reserved_3 Then Return -EINVAL |
| 10930 | If sample_type & ~(PERF_SAMPLE_MAX - 1) Then Return -EINVAL |
| 10933 | If read_format & ~(PERF_FORMAT_MAX - 1) Then Return -EINVAL |
| 10936 | If sample_type & PERF_SAMPLE_BRANCH_STACK Then |
| 10937 | mask = um perf_branch_sample_type |
| 10940 | If mask & ~(PERF_SAMPLE_BRANCH_MAX - 1) Then Return -EINVAL |
| 10944 | If Not (mask & ~PERF_SAMPLE_BRANCH_PLM_ALL) Then Return -EINVAL |
| 10948 | If Not (mask & PERF_SAMPLE_BRANCH_PLM_ALL) Then |
| 10951 | If Not ditto kernel Then mask |= PERF_SAMPLE_BRANCH_KERNEL |
| 10954 | If Not don't count user Then mask |= PERF_SAMPLE_BRANCH_USER |
| 10957 | If Not ditto hypervisor Then mask |= PERF_SAMPLE_BRANCH_HV |
| 10962 | um perf_branch_sample_type = mask |
| 10965 | If mask & anch priv levels that need permission checks Then |
| 10966 | ret = perf_allow_kernel(attr) |
| 10972 | If sample_type & PERF_SAMPLE_REGS_USER Then |
| 10978 | If sample_type & PERF_SAMPLE_STACK_USER Then |
| 10979 | If Not arch_perf_have_user_stack_dump() Then Return -ENOSYS |
| 10987 | If Defines size of the user stack to dump on samples. >= USHRT_MAX Then Return -EINVAL |
| 10989 | Else if Not IS_ALIGNED(Defines size of the user stack to dump on samples., sizeof(u64)) Then Return -EINVAL |
| 10993 | If Not sample_max_stack Then sample_max_stack = sysctl_perf_event_max_stack |
| 10998 | out : |
| 10999 | Return ret |
| 11001 | err_size : |
| 11002 | Write a simple value into user space( size of attr , & Size of the attr structure, for fwd/bwd compat.) |
| 11004 | Go to out |
| Name | Describe |
|---|---|
| _perf_ioctl |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |