函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\signal.c Create Date:2022-07-27 10:16:36
Last Modify:2020-03-17 13:28:47 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:This must be called with current->sighand->siglock held.* This should be the path for all ptrace stops.* We always set current->last_siginfo while stopped here.* That makes it a way to test a stopped process for

函数原型:static void ptrace_stop(int exit_code, int why, int clear_code, kernel_siginfo_t *info)__releases(&get_current()->sighand->siglock) __acquires(&get_current()->sighand->siglock)

返回类型:void

参数:

类型参数名称
intexit_code
intwhy
intclear_code
kernel_siginfo_t *info
2119  bool gstop_done = false
2121  如果When hitting ptrace_stop(), we cannot return using SYSRET because* that does not restore the full CPU state, only a minimal set(exit_code, info)则
2133  spin_unlock_irq( & siglock)
2134  arch_ptrace_stop - Do machine-specific work before stopping for ptrace*@code: current->exit_code value ptrace will stop with*@info: siginfo_t pointer (or %NULL) for signal ptrace will stop with* This is called with no locks held when (exit_code, info)
2135  spin_lock_irq( & siglock)
2136  如果Return non-zero if there is a SIGKILL that should be waking us up.* Called with the siglock held.则返回
2140  set_special_state() should be used for those states when the blocking task* can not use the regular condition based wait-loop. In that case we must* serialize against wakeups such that any possible in-flight TASK_RUNNING stores(TASK_TRACED)
2160  smp_wmb()
2162  last_siginfo等于info
2163  exit_code等于exit_code
2172  如果why恒等于child has stopped jobctl按位与JOBCTL_STOP_PENDINGgstop_done等于ask_participate_group_stop - participate in a group stop*@task: task participating in a group stop*@task has %JOBCTL_STOP_PENDING set and is participating in a group stop.* Group stop states are cleared and the group stop count is consumed if
2176  ask_clear_jobctl_pending - clear jobctl pending bits*@task: target task*@mask: pending bits to clear* Clear @mask from @task->jobctl. @mask must be subset of* %JOBCTL_PENDING_MASK. If %JOBCTL_STOP_PENDING is being cleared, other
2177  如果infosi_code右移8位恒等于Extended result codes which enabled by means other than options. ask_clear_jobctl_pending - clear jobctl pending bits*@task: target task*@mask: pending bits to clear* Clear @mask from @task->jobctl. @mask must be subset of* %JOBCTL_PENDING_MASK. If %JOBCTL_STOP_PENDING is being cleared, other
2181  ask_clear_jobctl_trapping - clear jobctl trapping bit*@task: target task* If JOBCTL_TRAPPING is set, a ptracer is waiting for us to enter TRACED.* Clear it and wake up the ptracer. Note that we don't need any further* locking
2183  spin_unlock_irq( & siglock)
2184  read_lock( & tasklist_lock)
2185  如果may_ptrace_stop()则
2196  do_notify_parent_cldstop - notify parent of stopped/continued state change*@tsk: task reporting the state change*@for_ptracer: the notification is for ptracer*@why: CLD_{CONTINUED|STOPPED|TRAPPED} to report
2197  如果gstop_doneptrace_reparented(当前进程)则do_notify_parent_cldstop - notify parent of stopped/continued state change*@tsk: task reporting the state change*@for_ptracer: the notification is for ptracer*@why: CLD_{CONTINUED|STOPPED|TRAPPED} to report
2206  禁止抢占()
2207  read_unlock( & tasklist_lock)
2208  cgroup_enter_frozen()
2209  preempt_enable_no_resched()
2210  freezable_schedule()
2211  cgroup_leave_frozen(true)
2212  否则
2223  如果gstop_donedo_notify_parent_cldstop - notify parent of stopped/continued state change*@tsk: task reporting the state change*@for_ptracer: the notification is for ptracer*@why: CLD_{CONTINUED|STOPPED|TRAPPED} to report
2227  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (就绪态)
2228  如果clear_codeexit_code等于0
2230  read_unlock( & tasklist_lock)
2238  spin_lock_irq( & siglock)
2239  last_siginfo = NULL
2242  jobctl与等于JOBCTL_LISTENING的反
2249  recalc_sigpending_tsk(当前进程)
调用者
名称描述
ptrace_do_notify
do_jobctl_trapdo_jobctl_trap - take care of ptrace jobctl traps* When PT_SEIZED, it's used for both group stop and explicit* SEIZE/INTERRUPT traps. Both generate PTRACE_EVENT_STOP trap with* accompanying siginfo. If stopped, lower eight bits of exit_code contain
ptrace_signal