函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:add_del_listener

函数原型:static int add_del_listener(pid_t pid, const struct cpumask *mask, int isadd)

返回类型:int

参数:

类型参数名称
pid_tpid
const struct cpumask *mask
intisadd
283  ret等于0
285  如果非pumask_subset - (*src1p & ~*src2p) == 0*@src1p: the first input*@src2p: the second input* Returns 1 if *@src1p is a subset of *@src2p, else returns 0则返回:负EINVAL
288  如果current_user_ns()不等于userns count is 1 for root user, 1 for init_uts_ns,* and 1 for... ?则返回:负EINVAL
291  如果取进程的空间不等于PID-map pages start out as NULL, they get allocated upon* first use and are never deallocated. This way a low pid_max* value does not cause lots of bitmaps to be allocated, but* the scheme scales to up to 4 million PIDs, runtime.则返回:负EINVAL
294  如果isadd恒等于REGISTER
296  s等于kmalloc_node(sizeof(structlistener), GFP_KERNEL, cpu_to_node(cpu))
298  如果非s
299  ret等于负ENOMEM
300  转到:cleanup
302  pid等于pid
303  valid等于1
305  listeners等于per_cpu(listener_array, cpu)
306  lock for writing
308  如果pid恒等于pidvalid则转到:exists
311  添加链表项
312  s = NULL
313  exists :
314  lease a write lock
315  kfree(s)
317  返回:0
321  cleanup :
323  listeners等于per_cpu(listener_array, cpu)
324  lock for writing
326  如果pid恒等于pid
327  删除链表项
328  kfree(s)
329  退出
332  lease a write lock
334  返回:ret
调用者
名称描述
cmd_attr_register_cpumask
cmd_attr_deregister_cpumask