函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\core.c Create Date:2022-07-27 10:37:11
Last Modify:2022-05-22 13:40:38 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Mimics kernel/events/core.c perf_copy_attr().

函数原型:static int sched_copy_attr(struct sched_attr __user *uattr, struct sched_attr *attr)

返回类型:int

参数:

类型参数名称
struct sched_attr __user *uattr
struct sched_attr *attr
5134  memset(attr, 0, attr的长度)
5136  ret等于Careful: we have to cast the result to the type of the pointer* for sign reasons(size, & size)
5137  如果ret则返回:ret
5141  如果非sizesize等于sizeof first published struct
5143  如果size小于sizeof first published struct size大于PAGE_SIZE则转到:err_size
5146  ret等于py_struct_from_user: copy a struct from userspace*@dst: Destination address, in kernel space
5147  如果ret
5148  如果ret恒等于负E2BIG则转到:err_size
5150  返回:ret
5153  如果sched_flags按位与SCHED_FLAG_UTIL_CLAMPsize小于add: util_{min,max} 则返回:负EINVAL
5161  SCHED_NORMAL, SCHED_BATCH 等于clamp - return a value clamped to a given range with strict typechecking*@val: current value*@lo: lowest allowable value*@hi: highest allowable value* This macro does strict typechecking of @lo/@hi to make sure they are of the* same type as @val(SCHED_NORMAL, SCHED_BATCH , MIN_NICE, MAX_NICE)
5163  返回:0
5165  err_size :
5166  put_user - Write a simple value into user space(attr的长度, & size)
5167  返回:负E2BIG
调用者
名称描述
SYSCALL_DEFINE3sys_sched_setattr - same as above, but with extended sched_attr*@pid: the pid in question.*@uattr: structure containing the extended parameters.*@flags: for future extension.