函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-27 10:03:12
Last Modify:2020-03-17 11:17:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:wait_task_stopped - Wait for %TASK_STOPPED or %TASK_TRACED*@wo: wait options*@ptrace: is the wait for ptrace*@p: task to wait for* Handle sys_wait4() work for %p in state %TASK_STOPPED or %TASK_TRACED

函数原型:static int wait_task_stopped(struct wait_opts *wo, int ptrace, struct task_struct *p)

返回类型:int

参数:

类型参数名称
struct wait_opts *wo
intptrace
struct task_struct *p
1138  uid等于0
1144  如果非ptrace且非wo_flags按位与WUNTRACED的值则返回:0
1147  如果非task_stopped_code(p, ptrace)则返回:0
1150  exit_code等于0
1151  spin_lock_irq( & siglock)
1153  p_code等于task_stopped_code(p, ptrace)
1154  如果此条件成立可能性小(为编译器优化)(!p_code)则转到:unlock_sig
1157  exit_code等于p_code
1158  如果非exit_code则转到:unlock_sig
1161  如果非此条件成立可能性小(为编译器优化)(wo_flags & Don't reap, just poll status. )则p_code等于0
1164  uid等于from_kuid_munged(current_user_ns(), task_uid(p))
1165  unlock_sig :
1166  spin_unlock_irq( & siglock)
1167  如果非exit_code则返回:0
1177  get_task_struct(p)
1178  pid等于task_pid_vnr(p)
1179  why等于如果ptraceraced child has trapped 否则child has stopped
1180  read_unlock( & tasklist_lock)
1181  sched_annotate_sleep()
1182  如果wo_rusagegetrusage(p, sys_wait4() uses this , wo_rusage)
1184  put_task_struct(p)
1186  如果此条件成立可能性大(为编译器优化)(!(wo_flags & Don't reap, just poll status. ))则wo_stat等于exit_code左移8位按位或0x7f
1189  infop等于wo_info
1190  如果infop
1191  cause等于why
1192  status等于exit_code
1193  pid等于pid
1194  uid等于uid
1196  返回:pid
调用者
名称描述
wait_consider_taskConsider @p for a wait by @parent