Commit c2bd1773 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

dump: Add comments on task seizing and stopping

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent 90160f59
......@@ -1070,6 +1070,12 @@ int cr_dump_tasks(pid_t pid, struct cr_options *opts)
if (collect_pstree(pid))
goto err;
/*
* Since ptrace-seize doesn't work on frozen tasks
* we stick with explicit tasks stopping via stop
* signal, but in future it's aimed to switch to
* kernel freezer.
*/
list_for_each_entry(item, &pstree_list, list) {
stop_task(item->pid);
if (opts->leader_only)
......
......@@ -192,6 +192,13 @@ int unseize_task(pid_t pid)
return ptrace(PTRACE_DETACH, pid, NULL, NULL);
}
/*
* This routine seizes task putting it into a special
* state where we can manipulate the task via ptrace
* inteface, and finally we can detach ptrace out of
* of it so the task would not know if it was saddled
* up with someone else.
*/
int seize_task(pid_t pid)
{
siginfo_t si;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment